1
0
mirror of https://github.com/postgres/postgres.git synced 2025-11-12 05:01:15 +03:00

Out-of-bounds memory allocation request sizes should be treated as just

elog(ERROR) not an Assert trap, since we've downgraded out-of-memory to
elog(ERROR) not a fatal error.  Also, change the hard boundary from 256Mb
to 1Gb, just so that anyone who's actually got that much memory to spare
can play with TOAST objects approaching a gigabyte.
This commit is contained in:
Tom Lane
2001-02-06 01:53:53 +00:00
parent 192ce19d36
commit 85c17dbff8
4 changed files with 14 additions and 25 deletions

View File

@@ -14,7 +14,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/mmgr/mcxt.c,v 1.26 2001/01/24 19:43:16 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/utils/mmgr/mcxt.c,v 1.27 2001/02/06 01:53:53 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -417,8 +417,9 @@ MemoryContextAlloc(MemoryContext context, Size size)
{
AssertArg(MemoryContextIsValid(context));
LogTrap(!AllocSizeIsValid(size), BadAllocSize,
("size=%d [0x%x]", size, size));
if (!AllocSizeIsValid(size))
elog(ERROR, "MemoryContextAlloc: invalid request size %lu",
(unsigned long) size);
return (*context->methods->alloc) (context, size);
}
@@ -474,8 +475,9 @@ repalloc(void *pointer, Size size)
AssertArg(MemoryContextIsValid(header->context));
LogTrap(!AllocSizeIsValid(size), BadAllocSize,
("size=%d [0x%x]", size, size));
if (!AllocSizeIsValid(size))
elog(ERROR, "repalloc: invalid request size %lu",
(unsigned long) size);
return (*header->context->methods->realloc) (header->context,
pointer, size);