X-Git-Url: https://git.exim.org/exim.git/blobdiff_plain/60e2e80a81b642a78a58997719dc26828eed2c2b..e0ae68c8ee6788508da4989ee0d6fcbaf40c7b97:/src/src/store.c diff --git a/src/src/store.c b/src/src/store.c index 346b0ccfc..df7078fea 100644 --- a/src/src/store.c +++ b/src/src/store.c @@ -3,7 +3,7 @@ *************************************************/ /* Copyright (c) University of Cambridge 1995 - 2018 */ -/* Copyright (c) The Exim maintainers 2019 */ +/* Copyright (c) The Exim maintainers 2019 - 2020 */ /* See the file NOTICE for conditions of use and distribution. */ /* Exim gets and frees all its store through these functions. In the original @@ -188,14 +188,14 @@ for (int pool = POOL_TAINT_BASE; pool < nelem(chainbase); pool++) if ((b = current_block[pool])) { uschar * bc = US b + ALIGNED_SIZEOF_STOREBLOCK; - if (US p >= bc && US p <= bc + b->length) return TRUE; + if (US p >= bc && US p < bc + b->length) return TRUE; } for (int pool = POOL_TAINT_BASE; pool < nelem(chainbase); pool++) for (b = chainbase[pool]; b; b = b->next) { uschar * bc = US b + ALIGNED_SIZEOF_STOREBLOCK; - if (US p >= bc && US p <= bc + b->length) return TRUE; + if (US p >= bc && US p < bc + b->length) return TRUE; } return FALSE; } @@ -301,10 +301,7 @@ store_last_get[pool] = next_yield[pool]; /* Cut out the debugging stuff for utilities, but stop picky compilers from giving warnings. */ -#ifdef COMPILE_UTILITY -func = func; -linenumber = linenumber; -#else +#ifndef COMPILE_UTILITY DEBUG(D_memory) debug_printf("---%d Get %6p %5d %-14s %4d\n", pool, store_last_get[pool], size, func, linenumber); @@ -395,10 +392,7 @@ if (CS ptr + rounded_oldsize != CS (next_yield[pool]) || /* Cut out the debugging stuff for utilities, but stop picky compilers from giving warnings. */ -#ifdef COMPILE_UTILITY -func = func; -linenumber = linenumber; -#else +#ifndef COMPILE_UTILITY DEBUG(D_memory) debug_printf("---%d Ext %6p %5d %-14s %4d\n", pool, ptr, newsize, func, linenumber); @@ -522,10 +516,7 @@ while ((b = bb)) /* Cut out the debugging stuff for utilities, but stop picky compilers from giving warnings. */ -#ifdef COMPILE_UTILITY -func = func; -linenumber = linenumber; -#else +#ifndef COMPILE_UTILITY DEBUG(D_memory) debug_printf("---%d Rst %6p %5d %-14s %4d %d\n", pool, ptr, count + oldmalloc - pool_malloc, @@ -609,10 +600,7 @@ for (int pool = 0; pool < nelem(current_block); pool++) /* Cut out the debugging stuff for utilities, but stop picky compilers from giving warnings. */ -#ifdef COMPILE_UTILITY - func = func; - linenumber = linenumber; -#else +#ifndef COMPILE_UTILITY DEBUG(D_memory) debug_printf("---%d Rel %6p %5d %-14s %4d %d\n", pool, ptr, count, func, linenumber, pool_malloc); @@ -683,10 +671,7 @@ for (storeblock * b = chainbase[pool]; b; b = b->next) /* Cut out the debugging stuff for utilities, but stop picky compilers from giving warnings. */ -#ifdef COMPILE_UTILITY - func = func; - linenumber = linenumber; -#else +#ifndef COMPILE_UTILITY DEBUG(D_memory) debug_printf("-Release %6p %-20s %4d %d\n", (void *)bb, func, linenumber, pool_malloc); @@ -781,10 +766,7 @@ if ((nonpool_malloc += size) > max_nonpool_malloc) /* Cut out the debugging stuff for utilities, but stop picky compilers from giving warnings. */ -#ifdef COMPILE_UTILITY -func = func; line = line; -#else - +#ifndef COMPILE_UTILITY /* If running in test harness, spend time making sure all the new store is not filled with zeros so as to catch problems. */ @@ -823,10 +805,7 @@ Returns: nothing static void internal_store_free(void * block, const char * func, int linenumber) { -#ifdef COMPILE_UTILITY -func = func; -linenumber = linenumber; -#else +#ifndef COMPILE_UTILITY DEBUG(D_memory) debug_printf("----Free %6p %-20s %4d\n", block, func, linenumber); #endif /* COMPILE_UTILITY */