This is an automated email from the ASF dual-hosted git repository.

andk pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mynewt-core.git


The following commit(s) were added to refs/heads/master by this push:
     new 27d02ccd4 baselibc: Add option to enable extra debugging for 
malloc/free
27d02ccd4 is described below

commit 27d02ccd424db135f19fb9480759d22676ed62ff
Author: Andrzej Kaczmarek <andrzej.kaczma...@codecoup.pl>
AuthorDate: Wed Oct 16 17:55:08 2024 +0200

    baselibc: Add option to enable extra debugging for malloc/free
---
 libc/baselibc/pkg.yml    | 3 +++
 libc/baselibc/syscfg.yml | 6 ++++++
 2 files changed, 9 insertions(+)

diff --git a/libc/baselibc/pkg.yml b/libc/baselibc/pkg.yml
index aa232757e..302f9b419 100644
--- a/libc/baselibc/pkg.yml
+++ b/libc/baselibc/pkg.yml
@@ -34,5 +34,8 @@ pkg.init.BASELIBC_THREAD_SAFE_HEAP_ALLOCATION:
 pkg.cflags:
     - -fno-builtin-malloc
 
+pkg.cflags.BASELIBC_DEBUG_MALLOC:
+    - -DDEBUG_MALLOC
+
 pkg.lflags:
     - -umain
diff --git a/libc/baselibc/syscfg.yml b/libc/baselibc/syscfg.yml
index 9820d8ed3..af331589f 100644
--- a/libc/baselibc/syscfg.yml
+++ b/libc/baselibc/syscfg.yml
@@ -41,3 +41,9 @@ syscfg.defs:
         description: >
             Set to 1 if project requires malloc/calloc/free to be thread safe.
         value: 0
+
+    BASELIBC_DEBUG_MALLOC:
+        description: >
+            Set to 1 to enable extra debugging for malloc/free calls.
+            This will e.g. assert on double-free.
+        value: 0

Reply via email to