mirror of
https://github.com/postgres/postgres.git
synced 2025-07-12 21:01:52 +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:
@ -1,4 +1,4 @@
|
||||
<!-- $PostgreSQL: pgsql/doc/src/sgml/xfunc.sgml,v 1.145 2010/04/03 07:22:56 petere Exp $ -->
|
||||
<!-- $PostgreSQL: pgsql/doc/src/sgml/xfunc.sgml,v 1.146 2010/04/28 16:54:15 tgl Exp $ -->
|
||||
|
||||
<sect1 id="xfunc">
|
||||
<title>User-Defined Functions</title>
|
||||
@ -3350,8 +3350,6 @@ void RequestAddinLWLocks(int n)
|
||||
|
||||
LWLockAcquire(AddinShmemInitLock, LW_EXCLUSIVE);
|
||||
ptr = ShmemInitStruct("my struct name", size, &found);
|
||||
if (!ptr)
|
||||
elog(ERROR, "out of shared memory");
|
||||
if (!found)
|
||||
{
|
||||
initialize contents of shmem area;
|
||||
|
Reference in New Issue
Block a user