From 24cdd6c71debfd10a9f7cb217fe2a2c4c486ed6f Mon Sep 17 00:00:00 2001 From: DJ Delorie Date: Wed, 29 Mar 2023 00:18:40 -0400 Subject: memalign: Support scanning for aligned chunks. This patch adds a chunk scanning algorithm to the _int_memalign code path that reduces heap fragmentation by reusing already aligned chunks instead of always looking for chunks of larger sizes and splitting them. The tcache macros are extended to allow removing a chunk from the middle of the list. The goal is to fix the pathological use cases where heaps grow continuously in workloads that are heavy users of memalign. Note that tst-memalign-2 checks for tcache operation, which malloc-check bypasses. Reviewed-by: Adhemerval Zanella --- malloc/Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'malloc/Makefile') diff --git a/malloc/Makefile b/malloc/Makefile index 0717df626e..f49675845e 100644 --- a/malloc/Makefile +++ b/malloc/Makefile @@ -43,6 +43,7 @@ tests := mallocbug tst-malloc tst-valloc tst-calloc tst-obstack \ tst-tcfree1 tst-tcfree2 tst-tcfree3 \ tst-safe-linking \ tst-mallocalign1 \ + tst-memalign-2 tests-static := \ tst-interpose-static-nothread \ @@ -70,7 +71,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-compathooks-off tst-compathooks-on tst-memalign-2 # Run all tests with MALLOC_CHECK_=3 tests-malloc-check = $(filter-out $(tests-exclude-malloc-check) \ -- cgit v1.2.3