diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2001-02-06 01:53:53 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2001-02-06 01:53:53 +0000 |
commit | 85c17dbff8ade0c5237e3ac1ece7cacacfdde399 (patch) | |
tree | 63209683720c582769cdb87e247d9dfa4f39320e /src/include/utils/memutils.h | |
parent | 192ce19d361b1a6ee5a6d7198ddb38780ec0cab8 (diff) | |
download | postgresql-85c17dbff8ade0c5237e3ac1ece7cacacfdde399.tar.gz postgresql-85c17dbff8ade0c5237e3ac1ece7cacacfdde399.zip |
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/include/utils/memutils.h')
-rw-r--r-- | src/include/utils/memutils.h | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/include/utils/memutils.h b/src/include/utils/memutils.h index 28cf6b33549..7ba0719dcb5 100644 --- a/src/include/utils/memutils.h +++ b/src/include/utils/memutils.h @@ -10,7 +10,7 @@ * Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $Id: memutils.h,v 1.41 2001/01/24 19:43:28 momjian Exp $ + * $Id: memutils.h,v 1.42 2001/02/06 01:53:52 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -22,16 +22,17 @@ /* * MaxAllocSize - * Arbitrary limit on size of allocations. + * Quasi-arbitrary limit on size of allocations. * * Note: * There is no guarantee that allocations smaller than MaxAllocSize * will succeed. Allocation requests larger than MaxAllocSize will * be summarily denied. * - * XXX This should be defined in a file of tunable constants. + * XXX This is deliberately chosen to correspond to the limiting size + * of varlena objects under TOAST. See VARATT_MASK_SIZE in postgres.h. */ -#define MaxAllocSize ((Size) 0xfffffff) /* 16G - 1 */ +#define MaxAllocSize ((Size) 0x3fffffff) /* 1 gigabyte - 1 */ #define AllocSizeIsValid(size) (0 < (size) && (size) <= MaxAllocSize) |