diff options
| author | Tom Lane | 2001-02-06 01:53:53 +0000 |
|---|---|---|
| committer | Tom Lane | 2001-02-06 01:53:53 +0000 |
| commit | 85c17dbff8ade0c5237e3ac1ece7cacacfdde399 (patch) | |
| tree | 63209683720c582769cdb87e247d9dfa4f39320e /src/backend/utils/mmgr | |
| parent | 192ce19d361b1a6ee5a6d7198ddb38780ec0cab8 (diff) | |
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.
Diffstat (limited to 'src/backend/utils/mmgr')
| -rw-r--r-- | src/backend/utils/mmgr/mcxt.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/backend/utils/mmgr/mcxt.c b/src/backend/utils/mmgr/mcxt.c index 0520cb6d0a6..ab8434a0581 100644 --- a/src/backend/utils/mmgr/mcxt.c +++ b/src/backend/utils/mmgr/mcxt.c @@ -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); |
