From 77acab75dfe2e4741c25c0cf550266caef1eebd2 Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Wed, 28 Apr 2010 16:54:16 +0000 Subject: Modify ShmemInitStruct and ShmemInitHash to throw errors internally, rather than returning NULL for some-but-not-all failures as they used to. Remove now-redundant tests for NULL from call sites. We had to do something about this because many call sites were failing to check for NULL; and changing it like this seems a lot more useful and mistake-proof than adding checks to the call sites without them. --- src/backend/access/transam/slru.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'src/backend/access/transam') diff --git a/src/backend/access/transam/slru.c b/src/backend/access/transam/slru.c index 6226acc9283..846d1b8a949 100644 --- a/src/backend/access/transam/slru.c +++ b/src/backend/access/transam/slru.c @@ -41,7 +41,7 @@ * Portions Copyright (c) 1996-2010, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $PostgreSQL: pgsql/src/backend/access/transam/slru.c,v 1.49 2010/02/16 22:34:43 tgl Exp $ + * $PostgreSQL: pgsql/src/backend/access/transam/slru.c,v 1.50 2010/04/28 16:54:15 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -164,8 +164,6 @@ SimpleLruInit(SlruCtl ctl, const char *name, int nslots, int nlsns, shared = (SlruShared) ShmemInitStruct(name, SimpleLruShmemSize(nslots, nlsns), &found); - if (!shared) - elog(ERROR, "out of shared memory"); if (!IsUnderPostmaster) { -- cgit v1.2.3