Skip to content

Commit 0615810

Browse files
committed
Add MALLOC_MMAP_THRESHOLD and documentation
1 parent 0c89bd3 commit 0615810

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/malloc/malloc.c

+3-2
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,9 @@
66

77
void set_malloc_flags() {
88
#ifndef __APPLE__
9-
setenv("MALLOC_PERTURB_", "85", 1);
10-
setenv("MALLOC_CHECK_", "2", 1);
9+
setenv("MALLOC_PERTURB_", "85", 1); // Data is overwritten
10+
setenv("MALLOC_CHECK_", "2", 1); // Enable some internal checks
11+
setenv("MALLOC_MMAP_THRESHOLD_", "1", 1); // Always use mmap()
1112
#else
1213
// setenv("DYLD_INSERT_LIBRARIES", "/usr/lib/libgmalloc.dylib", 1);
1314
setenv("MallocGuardEdges", "1", 1);

0 commit comments

Comments
 (0)