git://git.exim.org
/
users
/
heiko
/
exim.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
87193ab
)
Memory debug: do not try to save allocation bytes used for debug as ACL can modify...
author
Jeremy Harris
<jgh146exb@wizmail.org>
Sat, 27 Mar 2021 23:49:50 +0000
(23:49 +0000)
committer
Jeremy Harris
<jgh146exb@wizmail.org>
Sun, 28 Mar 2021 15:04:01 +0000
(16:04 +0100)
src/src/store.c
patch
|
blob
|
history
diff --git
a/src/src/store.c
b/src/src/store.c
index 8faefd492cc7d60dd081ccdb5e278c60fcde4b19..9de3f3ff1531bde443c812f5cc3ca8fb77166197 100644
(file)
--- a/
src/src/store.c
+++ b/
src/src/store.c
@@
-201,7
+201,6
@@
for (int i = 0; i < NPOOLS; i++)
yield_length[i] = -1;
store_block_order[i] = 12; /* log2(allocation_size) ie. 4kB */
}
yield_length[i] = -1;
store_block_order[i] = 12; /* log2(allocation_size) ie. 4kB */
}
-store_block_order[POOL_MAIN] = 13;
}
/******************************************************************************/
}
/******************************************************************************/
@@
-814,10
+813,7
@@
internal_store_malloc(int size, const char *func, int line)
{
void * yield;
{
void * yield;
-#ifndef COMPILE_UTILITY
-DEBUG(D_memory) size += sizeof(int); /* space to store the size */
-#endif
-
+size += sizeof(int); /* space to store the size, used under debug */
if (size < 16) size = 16;
if (!(yield = malloc((size_t)size)))
if (size < 16) size = 16;
if (!(yield = malloc((size_t)size)))
@@
-825,8
+821,9
@@
if (!(yield = malloc((size_t)size)))
"called from line %d in %s", size, line, func);
#ifndef COMPILE_UTILITY
"called from line %d in %s", size, line, func);
#ifndef COMPILE_UTILITY
-DEBUG(D_
memory) { *(int *)yield = size; yield = US yield + sizeof(int); }
+DEBUG(D_
any) *(int *)yield = size;
#endif
#endif
+yield = US yield + sizeof(int);
if ((nonpool_malloc += size) > max_nonpool_malloc)
max_nonpool_malloc = nonpool_malloc;
if ((nonpool_malloc += size) > max_nonpool_malloc)
max_nonpool_malloc = nonpool_malloc;
@@
-873,9
+870,9
@@
Returns: nothing
static void
internal_store_free(void * block, const char * func, int linenumber)
{
static void
internal_store_free(void * block, const char * func, int linenumber)
{
-uschar * p =
block
;
+uschar * p =
US block - sizeof(int)
;
#ifndef COMPILE_UTILITY
#ifndef COMPILE_UTILITY
-DEBUG(D_
memory) { p -= sizeof(int); nonpool_malloc -= *(int *)p; }
+DEBUG(D_
any) nonpool_malloc -= *(int *)p;
DEBUG(D_memory) debug_printf("----Free %6p %5d bytes\t%-20s %4d\n", block, *(int *)p, func, linenumber);
#endif
free(p);
DEBUG(D_memory) debug_printf("----Free %6p %5d bytes\t%-20s %4d\n", block, *(int *)p, func, linenumber);
#endif
free(p);