Michael Paquier <michael(dot)paquier(at)gmail(dot)com> writes:
> - mcxt.c uses that, which is surprising:
> @@ -704,7 +704,8 @@ MemoryContextCreate(NodeTag tag, Size size,
> {
> /* Special case for startup: use good ol' malloc */
> node = (MemoryContext) malloc(needed);
> - Assert(node != NULL);
> + if (node == NULL)
> + elog(PANIC, "out of memory");
> }
> I think that a PANIC is cleaner here instead of a simple crash.
But the elog mechanism assumes that memory contexts are working.
If this ever actually did fire, no good would come of it.
regards, tom lane