summaryrefslogtreecommitdiff
path: root/malloc/Makefile
diff options
context:
space:
mode:
authorFlorian Weimer <fweimer@redhat.com>2017-06-02 11:59:28 +0200
committerFlorian Weimer <fweimer@redhat.com>2017-06-02 11:59:28 +0200
commit91b6eb1140eda6bab324821ee3785e5d0ca155b8 (patch)
treec8b630c412611a9b9f5e600e8824661f403bfa7f /malloc/Makefile
parent09103e40252454e906a0b8543a142fc96b4c17c1 (diff)
Add internal facility for dynamic array handling
This is intended as a type-safe alternative to obstacks and hand-written realloc constructs. The implementation avoids writing function pointers to the heap.
Diffstat (limited to 'malloc/Makefile')
-rw-r--r--malloc/Makefile27
1 files changed, 25 insertions, 2 deletions
diff --git a/malloc/Makefile b/malloc/Makefile
index b7d4c63920..af025cbb24 100644
--- a/malloc/Makefile
+++ b/malloc/Makefile
@@ -41,17 +41,28 @@ tests-static := \
tests-internal := tst-mallocstate tst-scratch_buffer
+# The dynarray framework is only available inside glibc.
+tests-internal += \
+ tst-dynarray \
+ tst-dynarray-fail \
+ tst-dynarray-at-fail \
+
ifneq (no,$(have-tunables))
tests += tst-malloc-usable-tunables
tests-static += tst-malloc-usable-static-tunables
endif
tests += $(tests-static)
-test-srcs = tst-mtrace
+test-srcs = tst-mtrace tst-dynarray tst-dynarray-fail
routines = malloc morecore mcheck mtrace obstack reallocarray \
scratch_buffer_grow scratch_buffer_grow_preserve \
- scratch_buffer_set_array_size
+ scratch_buffer_set_array_size \
+ dynarray_at_failure \
+ dynarray_emplace_enlarge \
+ dynarray_finalize \
+ dynarray_resize \
+ dynarray_resize_clear \
install-lib := libmcheck.a
non-lib.a := libmcheck.a
@@ -137,6 +148,8 @@ ifeq ($(run-built-tests),yes)
ifeq (yes,$(build-shared))
ifneq ($(PERL),no)
tests-special += $(objpfx)tst-mtrace.out
+tests-special += $(objpfx)tst-dynarray-mem.out
+tests-special += $(objpfx)tst-dynarray-fail-mem.out
endif
endif
endif
@@ -208,3 +221,13 @@ $(objpfx)tst-interpose-thread: \
$(objpfx)tst-interpose-static-nothread: $(objpfx)tst-interpose-aux-nothread.o
$(objpfx)tst-interpose-static-thread: \
$(objpfx)tst-interpose-aux-thread.o $(static-thread-library)
+
+tst-dynarray-ENV = MALLOC_TRACE=$(objpfx)tst-dynarray.mtrace
+$(objpfx)tst-dynarray-mem.out: $(objpfx)tst-dynarray.out
+ $(common-objpfx)malloc/mtrace $(objpfx)tst-dynarray.mtrace > $@; \
+ $(evaluate-test)
+
+tst-dynarray-fail-ENV = MALLOC_TRACE=$(objpfx)tst-dynarray-fail.mtrace
+$(objpfx)tst-dynarray-fail-mem.out: $(objpfx)tst-dynarray-fail.out
+ $(common-objpfx)malloc/mtrace $(objpfx)tst-dynarray-fail.mtrace > $@; \
+ $(evaluate-test)