mirror of
https://git.postgresql.org/git/postgresql.git
synced 2024-10-02 14:11:21 +02:00
Extend #ifdef CLOBBER_FREED_MEMORY debugging option so that memory
freed wholesale by AllocSetReset() is overwritten too.
This commit is contained in:
parent
84a89e24ee
commit
6513946cbb
@ -8,7 +8,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/utils/mmgr/aset.c,v 1.24 2000/01/31 04:35:53 tgl Exp $
|
* $Header: /cvsroot/pgsql/src/backend/utils/mmgr/aset.c,v 1.25 2000/03/08 23:42:58 tgl Exp $
|
||||||
*
|
*
|
||||||
* NOTE:
|
* NOTE:
|
||||||
* This is a new (Feb. 05, 1999) implementation of the allocation set
|
* This is a new (Feb. 05, 1999) implementation of the allocation set
|
||||||
@ -173,6 +173,10 @@ AllocSetReset(AllocSet set)
|
|||||||
while (block != NULL)
|
while (block != NULL)
|
||||||
{
|
{
|
||||||
next = block->next;
|
next = block->next;
|
||||||
|
#ifdef CLOBBER_FREED_MEMORY
|
||||||
|
/* Wipe freed memory for debugging purposes */
|
||||||
|
memset(block, 0x7F, ((char *) block->endptr) - ((char *) block));
|
||||||
|
#endif
|
||||||
free(block);
|
free(block);
|
||||||
block = next;
|
block = next;
|
||||||
}
|
}
|
||||||
@ -419,6 +423,10 @@ AllocSetFree(AllocSet set, AllocPointer pointer)
|
|||||||
set->blocks = block->next;
|
set->blocks = block->next;
|
||||||
else
|
else
|
||||||
prevblock->next = block->next;
|
prevblock->next = block->next;
|
||||||
|
#ifdef CLOBBER_FREED_MEMORY
|
||||||
|
/* Wipe freed memory for debugging purposes */
|
||||||
|
memset(block, 0x7F, ((char *) block->endptr) - ((char *) block));
|
||||||
|
#endif
|
||||||
free(block);
|
free(block);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
Loading…
Reference in New Issue
Block a user