From 723019f727ce53b392389bdadcc1701ae47e6a14 Mon Sep 17 00:00:00 2001 From: David Oberhollenzer Date: Sun, 7 Mar 2021 18:15:50 +0100 Subject: Optionally use a pool allocator for rb-tree nodes This commit restructures the rbtree code to optionally use a pool allocator for the nodes. The option is made depenend on the presence of a pre-processor flag. To the configure script is added an option to enable/disable the use of custom allocators. It makes sense to still allow the malloc/free based routes for better ASAN based instrumentation. Signed-off-by: David Oberhollenzer --- lib/sqfs/Makemodule.am | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'lib/sqfs/Makemodule.am') diff --git a/lib/sqfs/Makemodule.am b/lib/sqfs/Makemodule.am index 9702b76..b770fd4 100644 --- a/lib/sqfs/Makemodule.am +++ b/lib/sqfs/Makemodule.am @@ -44,6 +44,10 @@ libsquashfs_la_SOURCES += lib/util/hash_table.c include/hash_table.h libsquashfs_la_SOURCES += lib/util/rbtree.c include/rbtree.h libsquashfs_la_SOURCES += lib/util/array.c include/array.h +if CUSTOM_ALLOC +libsquashfs_la_SOURCES += lib/util/mempool.c include/mempool.h +endif + if WINDOWS libsquashfs_la_SOURCES += lib/sqfs/win32/io_file.c libsquashfs_la_CFLAGS += -DWINVER=0x0600 -D_WIN32_WINNT=0x0600 -- cgit v1.2.3