diff --git a/chunk.c b/chunk.c index 9f3d52f..fb3f1fa 100644 --- a/chunk.c +++ b/chunk.c @@ -128,10 +128,12 @@ static char fence_top[FENCE_TOP_SIZE]; static int bit_sizes[BASIC_BLOCK]; /* number bits for div-blocks*/ /* memory tables */ +#if MEMORY_TABLE_TOP_LOG static mem_table_t mem_table_alloc; static mem_entry_t mem_table_alloc_entries[MEM_ALLOC_ENTRIES]; +#endif static mem_table_t mem_table_changed; -static mem_entry_t mem_table_changed_entries[MEM_ALLOC_ENTRIES]; +static mem_entry_t mem_table_changed_entries[MEM_CHANGED_ENTRIES]; /* memory stats */ static unsigned long alloc_current = 0; /* current memory usage */ @@ -1771,12 +1773,11 @@ int _dmalloc_chunk_startup(void) skip_free_list->sa_flags = ALLOC_FLAG_ADMIN; skip_address_list->sa_flags = ALLOC_FLAG_ADMIN; +#if MEMORY_TABLE_TOP_LOG _dmalloc_table_init(&mem_table_alloc, mem_table_alloc_entries, sizeof(mem_table_alloc_entries) / sizeof(*mem_table_alloc_entries)); - _dmalloc_table_init(&mem_table_changed, mem_table_changed_entries, - sizeof(mem_table_changed_entries) / - sizeof(*mem_table_changed_entries)); +#endif return 1; } diff --git a/chunk_loc.h b/chunk_loc.h index f9f43a7..aa5dcfd 100644 --- a/chunk_loc.h +++ b/chunk_loc.h @@ -55,7 +55,7 @@ #define MAX_SKIP_LEVEL 32 /* memory table settings */ -#define MEM_ALLOC_ENTRIES (MEMORY_TABLE_SIZE * 2) +#define MEM_ALLOC_ENTRIES (MEMORY_TABLE_TOP_LOG * 2) #define MEM_CHANGED_ENTRIES (MEMORY_TABLE_SIZE * 2) /* NOTE: FENCE_BOTTOM_SIZE and FENCE_TOP_SIZE defined in settings.h */