* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/utils/mmgr/aset.c,v 1.35 2000/12/05 23:40:36 tgl Exp $
+ * $Header: /cvsroot/pgsql/src/backend/utils/mmgr/aset.c,v 1.36 2001/01/06 21:59:39 tgl Exp $
*
* NOTE:
* This is a new (Feb. 05, 1999) implementation of the allocation set
block = (AllocBlock) malloc(blksize);
if (block == NULL)
+ {
+ MemoryContextStats(TopMemoryContext);
elog(ERROR, "Memory exhausted in AllocSetContextCreate()");
+ }
block->aset = context;
block->freeptr = ((char *) block) + ALLOC_BLOCKHDRSZ;
block->endptr = ((char *) block) + blksize;
blksize = chunk_size + ALLOC_BLOCKHDRSZ + ALLOC_CHUNKHDRSZ;
block = (AllocBlock) malloc(blksize);
if (block == NULL)
+ {
+ MemoryContextStats(TopMemoryContext);
elog(ERROR, "Memory exhausted in AllocSetAlloc()");
+ }
block->aset = set;
block->freeptr = block->endptr = ((char *) block) + blksize;
}
if (block == NULL)
+ {
+ MemoryContextStats(TopMemoryContext);
elog(ERROR, "Memory exhausted in AllocSetAlloc()");
+ }
block->aset = set;
block->freeptr = ((char *) block) + ALLOC_BLOCKHDRSZ;
blksize = chksize + ALLOC_BLOCKHDRSZ + ALLOC_CHUNKHDRSZ;
block = (AllocBlock) realloc(block, blksize);
if (block == NULL)
+ {
+ MemoryContextStats(TopMemoryContext);
elog(ERROR, "Memory exhausted in AllocSetReAlloc()");
+ }
block->freeptr = block->endptr = ((char *) block) + blksize;
/* Update pointers since block has likely been moved */