X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=src%2Fsrc%2Fstore.c;h=94becbb9004e5adce4344e7ecd07752dabcb519b;hb=f1be21cf0b8b97a64dfe17f2ca05bb4b9efe8d32;hp=8f5da3a5a7807a47927e7fdb804ea06b08c509b0;hpb=d4fd1b83a197d73cbac114fe53f3448d8b5c7cc2;p=exim.git diff --git a/src/src/store.c b/src/src/store.c index 8f5da3a5a..94becbb90 100644 --- a/src/src/store.c +++ b/src/src/store.c @@ -2,7 +2,7 @@ * Exim - an Internet mail transport agent * *************************************************/ -/* Copyright (c) University of Cambridge 1995 - 2017 */ +/* Copyright (c) University of Cambridge 1995 - 2018 */ /* See the file NOTICE for conditions of use and distribution. */ /* Exim gets and frees all its store through these functions. In the original @@ -194,7 +194,7 @@ linenumber = linenumber; #else DEBUG(D_memory) { - if (running_in_test_harness) + if (f.running_in_test_harness) debug_printf("---%d Get %5d\n", store_pool, size); else debug_printf("---%d Get %6p %5d %-14s %4d\n", store_pool, @@ -286,7 +286,7 @@ linenumber = linenumber; #else DEBUG(D_memory) { - if (running_in_test_harness) + if (f.running_in_test_harness) debug_printf("---%d Ext %5d\n", store_pool, newsize); else debug_printf("---%d Ext %6p %5d %-14s %4d\n", store_pool, ptr, newsize, @@ -354,10 +354,10 @@ the released memory. */ newlength = bc + b->length - CS ptr; #ifndef COMPILE_UTILITY -if (running_in_test_harness || debug_store) +if (debug_store) { assert_no_variables(ptr, newlength, filename, linenumber); - if (running_in_test_harness) + if (f.running_in_test_harness) { (void) VALGRIND_MAKE_MEM_DEFINED(ptr, newlength); memset(ptr, 0xF0, newlength); @@ -379,7 +379,7 @@ if (yield_length[store_pool] < STOREPOOL_MIN_SIZE && { b = b->next; #ifndef COMPILE_UTILITY - if (running_in_test_harness || debug_store) + if (debug_store) assert_no_variables(b, b->length + ALIGNED_SIZEOF_STOREBLOCK, filename, linenumber); #endif @@ -393,7 +393,7 @@ b->next = NULL; while ((b = bb)) { #ifndef COMPILE_UTILITY - if (running_in_test_harness || debug_store) + if (debug_store) assert_no_variables(b, b->length + ALIGNED_SIZEOF_STOREBLOCK, filename, linenumber); #endif @@ -411,7 +411,7 @@ linenumber = linenumber; #else DEBUG(D_memory) { - if (running_in_test_harness) + if (f.running_in_test_harness) debug_printf("---%d Rst ** %d\n", store_pool, pool_malloc); else debug_printf("---%d Rst %6p ** %-14s %4d %d\n", store_pool, ptr, @@ -442,11 +442,9 @@ Returns: nothing static void store_release_3(void * block, const char * filename, int linenumber) { -storeblock * b; - /* It will never be the first block, so no need to check that. */ -for (b = chainbase[store_pool]; b; b = b->next) +for (storeblock * b = chainbase[store_pool]; b; b = b->next) { storeblock * bb = b->next; if (bb && CS block == CS bb + ALIGNED_SIZEOF_STOREBLOCK) @@ -462,13 +460,13 @@ for (b = chainbase[store_pool]; b; b = b->next) linenumber = linenumber; #else DEBUG(D_memory) - if (running_in_test_harness) + if (f.running_in_test_harness) debug_printf("-Release %d\n", pool_malloc); else debug_printf("-Release %6p %-20s %4d %d\n", (void *)bb, filename, linenumber, pool_malloc); - if (running_in_test_harness) + if (f.running_in_test_harness) memset(bb, 0xF0, bb->length+ALIGNED_SIZEOF_STOREBLOCK); #endif /* COMPILE_UTILITY */ @@ -558,7 +556,7 @@ linenumber = linenumber; /* If running in test harness, spend time making sure all the new store is not filled with zeros so as to catch problems. */ -if (running_in_test_harness) +if (f.running_in_test_harness) { memset(yield, 0xF0, (size_t)size); DEBUG(D_memory) debug_printf("--Malloc %5d %d %d\n", size, pool_malloc, @@ -598,7 +596,7 @@ linenumber = linenumber; #else DEBUG(D_memory) { - if (running_in_test_harness) + if (f.running_in_test_harness) debug_printf("----Free\n"); else debug_printf("----Free %6p %-20s %4d\n", block, filename, linenumber);