File tree Expand file tree Collapse file tree 1 file changed +12
-3
lines changed Expand file tree Collapse file tree 1 file changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -155,13 +155,22 @@ InternalIpcMemoryCreate(IpcMemoryKey memKey, Size size)
155
155
}
156
156
}
157
157
#endif
158
+
158
159
/*
159
- * NEON: do not create shared memory segments for single user wal redo postgres.
160
- * Many spawned instances of wal redo may exhaust kernel.shmmni
160
+ * NEON: do not create shared memory segments for single user wal redo
161
+ * postgres. Many spawned instances of wal redo may exhaust kernel.shmmni
161
162
*/
162
163
if (am_wal_redo_postgres )
163
- return valloc (size );
164
+ {
165
+ void * ptr = malloc (size );
164
166
167
+ if (ptr == NULL )
168
+ {
169
+ ereport (FATAL ,
170
+ (errmsg ("could not create shared memory segment with size %zu for WAL redo process" , size )));
171
+ }
172
+ return ptr ;
173
+ }
165
174
shmid = shmget (memKey , size , IPC_CREAT | IPC_EXCL | IPCProtection );
166
175
167
176
if (shmid < 0 )
You can’t perform that action at this time.
0 commit comments