File tree 6 files changed +167
-21
lines changed
6 files changed +167
-21
lines changed Original file line number Diff line number Diff line change 24
24
* .i
25
25
* .txt
26
26
! docs /* .txt
27
+ ! CMakeLists.txt
27
28
RTE /
28
29
29
- # IAR Settings
30
- ** /settings /* .crun
31
- ** /settings /* .dbgdt
32
- ** /settings /* .cspy
33
- ** /settings /* .cspy. *
34
- ** /settings /* .xcl
35
- ** /settings /* .dni
36
- ** /settings /* .wsdt
37
- ** /settings /* .wspos
38
-
39
- # IAR Debug Exe
40
- ** /Exe /* .sim
41
-
42
- # IAR Debug Obj
43
- ** /Obj /* .pbd
44
- ** /Obj /* .pbd. *
45
- ** /Obj /* .pbi
46
- ** /Obj /* .pbi. *
30
+ * debug
31
+
32
+ # IAR Settings
33
+ ** /settings /* .crun
34
+ ** /settings /* .dbgdt
35
+ ** /settings /* .cspy
36
+ ** /settings /* .cspy. *
37
+ ** /settings /* .xcl
38
+ ** /settings /* .dni
39
+ ** /settings /* .wsdt
40
+ ** /settings /* .wspos
41
+
42
+ # IAR Debug Exe
43
+ ** /Exe /* .sim
44
+
45
+ # IAR Debug Obj
46
+ ** /Obj /* .pbd
47
+ ** /Obj /* .pbd. *
48
+ ** /Obj /* .pbi
49
+ ** /Obj /* .pbi. *
47
50
48
51
* .TMP
49
52
/docs_src /x_Doxyfile.doxy
69
72
[Dd ]ebugPublic /
70
73
[Rr ]elease /
71
74
[Rr ]eleases /
75
+ [Dd ]ebug * /
72
76
x64 /
73
77
x86 /
74
78
bld /
75
79
[Bb ]in /
76
80
[Oo ]bj /
77
81
[Ll ]og /
78
82
_build /
83
+ build /
79
84
80
85
# Visual Studio 2015/2017 cache/options directory
81
86
.vs /
@@ -274,7 +279,7 @@ ClientBin/
274
279
* .publishsettings
275
280
orleans.codegen.cs
276
281
277
- # Including strong name files can present a security risk
282
+ # Including strong name files can present a security risk
278
283
# (https://github.com/github/gitignore/pull/2483#issue-259490424)
279
284
# *.snk
280
285
@@ -370,7 +375,7 @@ __pycache__/
370
375
# OpenCover UI analysis results
371
376
OpenCover /
372
377
373
- # Azure Stream Analytics local run output
378
+ # Azure Stream Analytics local run output
374
379
ASALocalRun /
375
380
376
381
# MSBuild Binary and Structured Log
@@ -383,3 +388,13 @@ log_file.txt
383
388
project.ioc
384
389
mx.scratch
385
390
* .tilen majerle
391
+
392
+
393
+ # Altium
394
+ Project outputs *
395
+ History /
396
+ * .SchDocPreview
397
+ * .$$$Preview
398
+
399
+ # VSCode projects
400
+ project_vscode_compiled.exe
Original file line number Diff line number Diff line change
1
+ {
2
+ "version" : 4 ,
3
+ "configurations" : [
4
+ {
5
+ "name" : " Win32" ,
6
+ "includePath" : [
7
+ " ${workspaceFolder}\\ dev\\ VisualStudio\\ " ,
8
+ " ${workspaceFolder}\\ lwmem\\ src\\ include\\ "
9
+ ],
10
+ "defines" : [
11
+ " WIN32" ,
12
+ " _DEBUG" ,
13
+ " UNICODE" ,
14
+ " _UNICODE" ,
15
+ " LWMEM_DEV"
16
+ ],
17
+ "compilerPath" : " c:\\ msys64\\ mingw64\\ bin\\ gcc.exe" ,
18
+ "cStandard" : " gnu17" ,
19
+ "cppStandard" : " gnu++14" ,
20
+ "intelliSenseMode" : " windows-gcc-x86" ,
21
+ "configurationProvider" : " ms-vscode.cmake-tools"
22
+ }
23
+ ]
24
+ }
Original file line number Diff line number Diff line change
1
+ {
2
+ // Use IntelliSense to learn about possible attributes.
3
+ // Hover to view descriptions of existing attributes.
4
+ // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
5
+ "version" : " 0.2.0" ,
6
+ "configurations" : [
7
+ {
8
+ "name" : " (Windows) Launch" ,
9
+ "type" : " cppvsdbg" ,
10
+ "request" : " launch" ,
11
+ "program" : " ${workspaceFolder}\\ build\\ LwPRINTF.exe" ,
12
+ "miDebuggerPath" : " c:\\ msys64\\ mingw64\\ bin\\ gdb.exe" ,
13
+ "args" : [],
14
+ "stopAtEntry" : false ,
15
+ "cwd" : " ${fileDirname}" ,
16
+ "environment" : [],
17
+ "console" : " integratedTerminal"
18
+ }
19
+ ]
20
+ }
Original file line number Diff line number Diff line change
1
+ {
2
+ "version" : " 2.0.0" ,
3
+
4
+ /* For this builds, you need
5
+ *
6
+ * - Ninja build system
7
+ * - MSYS2 compiler with ninja support
8
+ * - C/C++ extension for VSCode
9
+ * - CMake-Tools extension for VSCode
10
+ */
11
+ "tasks" : [
12
+ {
13
+ "type" : " cppbuild" ,
14
+ "label" : " Build project" ,
15
+ "command" : " cmake" ,
16
+ "args" : [
17
+ " --build" ,
18
+ " \" build\" "
19
+ ],
20
+ "options" : {
21
+ "cwd" : " ${workspaceFolder}"
22
+ },
23
+ "problemMatcher" : [
24
+ " $gcc"
25
+ ],
26
+ "group" : {
27
+ "kind" : " build" ,
28
+ "isDefault" : true
29
+ }
30
+ },
31
+ {
32
+ "type" : " shell" ,
33
+ "label" : " Clean project" ,
34
+ "command" : " cmake" ,
35
+ "args" : [
36
+ " --build" ,
37
+ " \" build\" " ,
38
+ " --target" ,
39
+ " clean"
40
+ ],
41
+ "options" : {
42
+ "cwd" : " ${workspaceFolder}"
43
+ },
44
+ "problemMatcher" : []
45
+ },
46
+ {
47
+ "type" : " shell" ,
48
+ "label" : " Run application" ,
49
+ "command" : " ${workspaceFolder}\\ build\\ LwMEM.exe" ,
50
+ "args" : [],
51
+ "problemMatcher" : [],
52
+ },
53
+ ]
54
+ }
Original file line number Diff line number Diff line change
1
+ cmake_minimum_required (VERSION 3.0.0)
2
+ project (LwMEM VERSION 0.1.0)
3
+
4
+ include (CTest)
5
+ enable_testing ()
6
+
7
+ add_executable (${PROJECT_NAME}
8
+ lwmem/src/lwmem/lwmem.c
9
+ lwmem/src/system /lwmem_sys_win32.c
10
+ tests/lwmem_test.c
11
+ dev/VisualStudio/main.c
12
+ )
13
+
14
+ target_include_directories (${PROJECT_NAME} PRIVATE
15
+ dev/VisualStudio
16
+ lwmem/src/include
17
+ )
18
+
19
+ target_compile_definitions (${PROJECT_NAME} PRIVATE
20
+ WIN32
21
+ _DEBUG
22
+ CONSOLE
23
+ LWMEM_DEV
24
+ )
25
+
26
+ set (CPACK_PROJECT_NAME ${PROJECT_NAME} )
27
+ set (CPACK_PROJECT_VERSION ${PROJECT_VERSION} )
28
+ include (CPack)
Original file line number Diff line number Diff line change 1
1
#include "lwmem/lwmem.h"
2
+ #include <stdio.h>
2
3
3
4
/* Assert check */
4
5
#define ASSERT (x ) do { \
11
12
12
13
/********************************************/
13
14
/* Test case helpers */
14
- #define IS_ALLOC_IN_REGION (ptr , region ) ASSERT((unsigned char *)(ptr) >= (region)->start_addr && (unsigned char *)(ptr) < ((unsigned char *)(region)->start_addr + (region)->size))
15
+ #define UINT_PTR_CAST (x ) ((uintptr_t)(x))
16
+ #define IS_ALLOC_IN_REGION (ptr , region ) ASSERT( \
17
+ UINT_PTR_CAST(ptr) >= UINT_PTR_CAST((region)->start_addr) \
18
+ && UINT_PTR_CAST(ptr) < (UINT_PTR_CAST((region)->start_addr) + (region)->size) \
19
+ )
15
20
16
21
/********************************************/
17
22
/* Configuration for default lwmem instance */
You can’t perform that action at this time.
0 commit comments