aboutsummaryrefslogtreecommitdiff
path: root/malloc/Makefile
diff options
context:
space:
mode:
authorDJ Delorie <dj@redhat.com>2023-04-03 17:33:03 -0400
committerDJ Delorie <dj@redhat.com>2023-04-18 10:58:42 -0400
commite5524ef335dc8e28d64cc376d57c219e566fcf53 (patch)
tree92fc25b1af0bbc50710619d42aeba02c17baa0c7 /malloc/Makefile
parent8895a99c10349e5b0bb57b64c229389169a312e0 (diff)
downloadglibc-e5524ef335dc8e28d64cc376d57c219e566fcf53.zip
glibc-e5524ef335dc8e28d64cc376d57c219e566fcf53.tar.gz
glibc-e5524ef335dc8e28d64cc376d57c219e566fcf53.tar.bz2
malloc: set NON_MAIN_ARENA flag for reclaimed memalign chunk (BZ #30101)
Based on these comments in malloc.c: size field is or'ed with NON_MAIN_ARENA if the chunk was obtained from a non-main arena. This is only set immediately before handing the chunk to the user, if necessary. The NON_MAIN_ARENA flag is never set for unsorted chunks, so it does not have to be taken into account in size comparisons. When we pull a chunk off the unsorted list (or any list) we need to make sure that flag is set properly before returning the chunk. Use the rounded-up size for chunk_ok_for_memalign() Do not scan the arena for reusable chunks if there's no arena. Account for chunk overhead when determining if a chunk is a reuse candidate. mcheck interferes with memalign, so skip mcheck variants of memalign tests. Reviewed-by: Carlos O'Donell <carlos@redhat.com> Tested-by: Carlos O'Donell <carlos@redhat.com>
Diffstat (limited to 'malloc/Makefile')
-rw-r--r--malloc/Makefile7
1 files changed, 5 insertions, 2 deletions
diff --git a/malloc/Makefile b/malloc/Makefile
index f496758..071dfdb 100644
--- a/malloc/Makefile
+++ b/malloc/Makefile
@@ -43,7 +43,8 @@ tests := mallocbug tst-malloc tst-valloc tst-calloc tst-obstack \
tst-tcfree1 tst-tcfree2 tst-tcfree3 \
tst-safe-linking \
tst-mallocalign1 \
- tst-memalign-2
+ tst-memalign-2 \
+ tst-memalign-3
tests-static := \
tst-interpose-static-nothread \
@@ -71,7 +72,7 @@ test-srcs = tst-mtrace
# with MALLOC_CHECK_=3 because they expect a specific failure.
tests-exclude-malloc-check = tst-malloc-check tst-malloc-usable \
tst-mxfast tst-safe-linking \
- tst-compathooks-off tst-compathooks-on tst-memalign-2
+ tst-compathooks-off tst-compathooks-on tst-memalign-2 tst-memalign-3
# Run all tests with MALLOC_CHECK_=3
tests-malloc-check = $(filter-out $(tests-exclude-malloc-check) \
@@ -116,6 +117,8 @@ tests-exclude-mcheck = tst-mallocstate \
tst-malloc-usable-tunables \
tst-malloc_info \
tst-compathooks-off tst-compathooks-on \
+ tst-memalign-2 \
+ tst-memalign-3 \
tst-mxfast
tests-mcheck = $(filter-out $(tests-exclude-mcheck) $(tests-static), $(tests))