Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitcbdaa27

Browse files
committed
Repair missing MEMORY_CONTEXT_CHECKING logic for realloc().
Doesn't anyone around here run regression tests before submittingpatches, or before committing them?
1 parentbadce86 commitcbdaa27

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

‎src/backend/utils/mmgr/aset.c

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
* Portions Copyright (c) 1994, Regents of the University of California
1212
*
1313
* IDENTIFICATION
14-
* $Header: /cvsroot/pgsql/src/backend/utils/mmgr/aset.c,v 1.30 2000/07/1202:37:23 tgl Exp $
14+
* $Header: /cvsroot/pgsql/src/backend/utils/mmgr/aset.c,v 1.31 2000/07/1205:15:20 tgl Exp $
1515
*
1616
* NOTE:
1717
*This is a new (Feb. 05, 1999) implementation of the allocation set
@@ -696,7 +696,17 @@ AllocSetRealloc(MemoryContext context, void *pointer, Size size)
696696
*/
697697
oldsize=AllocPointerGetSize(pointer);
698698
if (oldsize >=size)
699+
{
700+
#ifdefMEMORY_CONTEXT_CHECKING
701+
AllocChunkchunk=AllocPointerGetChunk(pointer);
702+
703+
/* mark memory for memory leak searching */
704+
memset(((char*)chunk)+ (ALLOC_CHUNKHDRSZ+size),
705+
0x7F,chunk->size-size);
706+
chunk->data_size=size;
707+
#endif
699708
returnpointer;
709+
}
700710

701711
if (oldsize >=ALLOC_BIGCHUNK_LIMIT)
702712
{
@@ -711,7 +721,6 @@ AllocSetRealloc(MemoryContext context, void *pointer, Size size)
711721
AllocBlockblock=set->blocks;
712722
AllocBlockprevblock=NULL;
713723
Sizeblksize;
714-
715724
#ifdefMEMORY_CONTEXT_CHECKING
716725
Sizedata_size=size;
717726
#endif

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp