Skip to content

Commit c0d7f86

Browse files
baselibc: Add option to enable extra debugging for malloc/free
1 parent 129d67e commit c0d7f86

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

libc/baselibc/pkg.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,9 @@ pkg.init.BASELIBC_THREAD_SAFE_HEAP_ALLOCATION:
3434
pkg.cflags:
3535
- -fno-builtin-malloc
3636

37+
pkg.cflags.BASELIBC_DEBUG_MALLOC:
38+
- -DDEBUG_MALLOC
39+
3740
pkg.lflags:
3841
- -specs=nosys.specs:
3942
- -umain

libc/baselibc/syscfg.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,3 +41,9 @@ syscfg.defs:
4141
description: >
4242
Set to 1 if project requires malloc/calloc/free to be thread safe.
4343
value: 0
44+
45+
BASELIBC_DEBUG_MALLOC:
46+
description: >
47+
Set to 1 to enable extra debugging for malloc/free calls.
48+
This will e.g. assert on double-free.
49+
value: 0

0 commit comments

Comments
 (0)