musl - musl - an implementation of the standard library for Linux-based systems

index : musl
musl - an implementation of the standard library for Linux-based systems
summary refs log tree commit diff
path: root/src/malloc/malloc.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/malloc/malloc.c')
-rw-r--r--src/malloc/malloc.c 6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/malloc/malloc.c b/src/malloc/malloc.c
index 88a31ae4..1a6d1493 100644
--- a/src/malloc/malloc.c
+++ b/src/malloc/malloc.c
@@ -196,7 +196,11 @@ static int init_malloc(size_t n)
return 0;
}
- mal.brk = __brk(0) + 2*SIZE_ALIGN-1 & -SIZE_ALIGN;
+ mal.brk = __brk(0);
+#ifdef SHARED
+ mal.brk = mal.brk + PAGE_SIZE-1 & -PAGE_SIZE;
+#endif
+ mal.brk = mal.brk + 2*SIZE_ALIGN-1 & -SIZE_ALIGN;
c = expand_heap(n);
generated by cgit v1.2.1 (git 2.18.0) at 2025年09月14日 21:48:54 +0000

AltStyle によって変換されたページ (->オリジナル) /