Commit e3cf8b806c3ca919f95b9d33d6037869a059c035

Ole André Vadla Ravnås 2022-03-31T14:42:03

Allow system to have overlapping mallopt defines (#700) Which is the case on some OSes, such as QNX.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
diff --git a/src/dlmalloc.c b/src/dlmalloc.c
index 1aba657..6f4a5f6 100644
--- a/src/dlmalloc.c
+++ b/src/dlmalloc.c
@@ -592,6 +592,11 @@ DEFAULT_MMAP_THRESHOLD       default: 256K
   malloc does support the following options.
 */
 
+/* The system's malloc.h may have conflicting defines. */
+#undef M_TRIM_THRESHOLD
+#undef M_GRANULARITY
+#undef M_MMAP_THRESHOLD
+
 #define M_TRIM_THRESHOLD     (-1)
 #define M_GRANULARITY        (-2)
 #define M_MMAP_THRESHOLD     (-3)