1
0
mirror of https://github.com/postgres/postgres.git synced 2025-11-06 07:49:08 +03:00

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.
This commit is contained in:
Tom Lane
2010-04-28 16:54:16 +00:00
parent 5f70a04c56
commit 77acab75df
12 changed files with 87 additions and 112 deletions

View File

@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/storage/lmgr/lock.c,v 1.196 2010/03/21 00:17:58 petere Exp $
* $PostgreSQL: pgsql/src/backend/storage/lmgr/lock.c,v 1.197 2010/04/28 16:54:16 tgl Exp $
*
* NOTES
* A lock table is a shared memory hash table. When
@@ -306,8 +306,6 @@ InitLocks(void)
max_table_size,
&info,
hash_flags);
if (!LockMethodLockHash)
elog(FATAL, "could not initialize lock hash table");
/* Assume an average of 2 holders per lock */
max_table_size *= 2;
@@ -328,8 +326,6 @@ InitLocks(void)
max_table_size,
&info,
hash_flags);
if (!LockMethodProcLockHash)
elog(FATAL, "could not initialize proclock hash table");
/*
* Allocate non-shared hash table for LOCALLOCK structs. This stores lock