diff options
author | Wilco Dijkstra <wilco.dijkstra@arm.com> | 2025-08-08 13:59:31 +0000 |
---|---|---|
committer | Wilco Dijkstra <wilco.dijkstra@arm.com> | 2025-08-08 13:59:31 +0000 |
commit | 94ebcfc4f253129ca772392fe034eea6c0aa6963 (patch) | |
tree | 04a3b8c604a2731c67e3c9772c0df410f0f97f70 /malloc/malloc.c | |
parent | fd9ffafc0eaad3b4ff576f4d291d2e9336e6019b (diff) | |
download | glibc-94ebcfc4f253129ca772392fe034eea6c0aa6963.zip glibc-94ebcfc4f253129ca772392fe034eea6c0aa6963.tar.gz glibc-94ebcfc4f253129ca772392fe034eea6c0aa6963.tar.bz2 |
malloc: Remove use of __curbrk
Remove an odd use of __curbrk and use MORECORE (0) instead.
This fixes Hurd build since it doesn't define this symbol.
Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Diffstat (limited to 'malloc/malloc.c')
-rw-r--r-- | malloc/malloc.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/malloc/malloc.c b/malloc/malloc.c index 9d646ab..5257ee2 100644 --- a/malloc/malloc.c +++ b/malloc/malloc.c @@ -2642,13 +2642,11 @@ sysmalloc (INTERNAL_SIZE_T nb, mstate av) previous calls. Otherwise, we correct to page-align below. */ - /* Defined in brk.c. */ - extern void *__curbrk; if (__glibc_unlikely (mp_.thp_pagesize != 0)) { - uintptr_t top = ALIGN_UP ((uintptr_t) __curbrk + size, - mp_.thp_pagesize); - size = top - (uintptr_t) __curbrk; + uintptr_t lastbrk = (uintptr_t) MORECORE (0); + uintptr_t top = ALIGN_UP (lastbrk + size, mp_.thp_pagesize); + size = top - lastbrk; } else size = ALIGN_UP (size, GLRO(dl_pagesize)); |