1
0
mirror of https://sourceware.org/git/glibc.git synced 2025-08-10 05:03:06 +03:00

malloc: Add THP/madvise support for sbrk

To increase effectiveness with Transparent Huge Page with madvise, the
large page size is use instead page size for sbrk increment for the
main arena.

Checked on x86_64-linux-gnu.

Reviewed-by: DJ Delorie <dj@redhat.com>
This commit is contained in:
Adhemerval Zanella
2021-08-13 10:06:04 -03:00
parent 5f6d8d97c6
commit 7478c9959a
2 changed files with 37 additions and 5 deletions

View File

@@ -60,4 +60,12 @@
#define PTR_ALIGN_UP(base, size) \
((__typeof__ (base)) ALIGN_UP ((uintptr_t) (base), (size)))
/* Check if BASE is aligned on SIZE */
#define PTR_IS_ALIGNED(base, size) \
((((uintptr_t) (base)) & (size - 1)) == 0)
/* Returns the ptrdiff_t diference between P1 and P2. */
#define PTR_DIFF(p1, p2) \
((ptrdiff_t)((uintptr_t)(p1) - (uintptr_t)(p2)))
#endif