From 0213cd6f2353d90ccd76eb5093ae42e13f96087a Mon Sep 17 00:00:00 2001 From: Xiang Xiao Date: Wed, 21 Apr 2021 23:27:45 +0800 Subject: [PATCH 1/2] Make MAX_SKIP_LEVEL configurable by moving from chunk_loc.h to settings.dist Signed-off-by: Xiang Xiao Change-Id: Id174656f9874e3930b586f29b8d7aaa66436c9f5 --- chunk_loc.h | 6 ------ settings.dist | 6 ++++++ 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/chunk_loc.h b/chunk_loc.h index f9f43a71..c295fb6a 100644 --- a/chunk_loc.h +++ b/chunk_loc.h @@ -48,12 +48,6 @@ /* log-bad-space info */ #define SPECIAL_CHARS "\"\"''\\\\n\nr\rt\tb\bf\fa\007" -/* - * Maximum level in the skip list. This implies that we can only - * store 2^32 entries optimally. Needless to say this is plenty. - */ -#define MAX_SKIP_LEVEL 32 - /* memory table settings */ #define MEM_ALLOC_ENTRIES (MEMORY_TABLE_SIZE * 2) #define MEM_CHANGED_ENTRIES (MEMORY_TABLE_SIZE * 2) diff --git a/settings.dist b/settings.dist index ecf374fd..52bb6837 100644 --- a/settings.dist +++ b/settings.dist @@ -126,6 +126,12 @@ #define MAX_FILE_LENGTH 100 #define MAX_LINE_NUMBER 30000 +/* + * Maximum level in the skip list. This implies that we can only + * store 2^32 entries optimally. Needless to say this is plenty. + */ +#define MAX_SKIP_LEVEL 32 + /* * The largest allowable allocation size. This is only for * verification purposes to control allocations of bizarre sizes. Any From 16db6828ece4630fbb4e527ea553a2e18a99ee21 Mon Sep 17 00:00:00 2001 From: Xiang Xiao Date: Thu, 22 Apr 2021 11:12:29 +0800 Subject: [PATCH 2/2] Make MAX_QSORT_SPLITS and MAX_QSORT_PARTITION configurable Signed-off-by: Xiang Xiao Change-Id: I30d99079ebbda0c9f276122cc5d07b8d03e264dd --- dmalloc_tab_loc.h | 17 ----------------- settings.dist | 14 ++++++++++++++ 2 files changed, 14 insertions(+), 17 deletions(-) diff --git a/dmalloc_tab_loc.h b/dmalloc_tab_loc.h index 42219e61..fad65594 100644 --- a/dmalloc_tab_loc.h +++ b/dmalloc_tab_loc.h @@ -24,23 +24,6 @@ #include "conf.h" -/* - * Maximum number of splits. This should mean that these routines can - * handle at least 2^128 different values (that's _quite_ a few). And - * then you can always increase the value. - */ -#define MAX_QSORT_SPLITS 128 - -/* - * Maximum number of entries that must be in list for it to be - * partitioned. If there are fewer elements then just do our - * insertion sort. - */ -#define MAX_QSORT_PARTITION 8 - -/* comparison function */ -typedef int (*compare_t)(const void *element1_p, const void *element2_p); - /* * void HASH_MIX * diff --git a/settings.dist b/settings.dist index 52bb6837..0eddb3dc 100644 --- a/settings.dist +++ b/settings.dist @@ -347,6 +347,20 @@ */ #define FREED_POINTER_DELAY 20 +/* + * Maximum number of splits. This should mean that these routines can + * handle at least 2^128 different values (that's _quite_ a few). And + * then you can always increase the value. + */ +#define MAX_QSORT_SPLITS 128 + +/* + * Maximum number of entries that must be in list for it to be + * partitioned. If there are fewer elements then just do our + * insertion sort. + */ +#define MAX_QSORT_PARTITION 8 + /* * Size of the table of file and line number memory entries. This * memory table records the top locations by file/line or