summaryrefslogtreecommitdiff
path: root/libc/stdlib
diff options
context:
space:
mode:
Diffstat (limited to 'libc/stdlib')
-rw-r--r--libc/stdlib/malloc-simple/alloc.c2
-rw-r--r--libc/stdlib/malloc-standard/malloc.h2
-rw-r--r--libc/stdlib/malloc/malloc.c2
3 files changed, 3 insertions, 3 deletions
diff --git a/libc/stdlib/malloc-simple/alloc.c b/libc/stdlib/malloc-simple/alloc.c
index 36355c1e9..51da14ac8 100644
--- a/libc/stdlib/malloc-simple/alloc.c
+++ b/libc/stdlib/malloc-simple/alloc.c
@@ -36,7 +36,7 @@ void *malloc(size_t size)
#ifdef __ARCH_USE_MMU__
# define MMAP_FLAGS MAP_PRIVATE | MAP_ANONYMOUS
#else
-# define MMAP_FLAGS MAP_SHARED | MAP_ANONYMOUS
+# define MMAP_FLAGS MAP_SHARED | MAP_ANONYMOUS | MAP_UNINITIALIZE
#endif
result = mmap((void *) 0, size + sizeof(size_t), PROT_READ | PROT_WRITE,
diff --git a/libc/stdlib/malloc-standard/malloc.h b/libc/stdlib/malloc-standard/malloc.h
index 90c9fd14d..7a2e66d16 100644
--- a/libc/stdlib/malloc-standard/malloc.h
+++ b/libc/stdlib/malloc-standard/malloc.h
@@ -356,7 +356,7 @@ __UCLIBC_MUTEX_EXTERN(__malloc_lock);
#else
#define MMAP(addr, size, prot) \
- (mmap((addr), (size), (prot), MAP_SHARED|MAP_ANONYMOUS, 0, 0))
+ (mmap((addr), (size), (prot), MAP_SHARED|MAP_ANONYMOUS|MAP_UNINITIALIZE, 0, 0))
#endif
diff --git a/libc/stdlib/malloc/malloc.c b/libc/stdlib/malloc/malloc.c
index f4bbc71a2..337206f09 100644
--- a/libc/stdlib/malloc/malloc.c
+++ b/libc/stdlib/malloc/malloc.c
@@ -124,7 +124,7 @@ __malloc_from_heap (size_t size, struct heap_free_area **heap
MAP_PRIVATE | MAP_ANONYMOUS, 0, 0);
#else
block = mmap ((void *)0, block_size, PROT_READ | PROT_WRITE,
- MAP_SHARED | MAP_ANONYMOUS, 0, 0);
+ MAP_SHARED | MAP_ANONYMOUS | MAP_UNINITIALIZE, 0, 0);
#endif
#endif /* MALLOC_USE_SBRK */