Add palloc_extended for frontend and backend.
Fujii Masao <fujii@postgresql.org>
Add palloc_extended for frontend and backend. This commit also adds pg_malloc_extended for frontend. These interfaces can be used to control at a lower level memory allocation using an interface similar to MemoryContextAllocExtended. For example, the callers can specify MCXT_ALLOC_NO_OOM if they want to suppress the "out of memory" error while allocating the memory and handle a NULL return value. Michael Paquier, reviewed by me.
Files
| Path | Change | +/− |
|---|---|---|
| src/backend/utils/mmgr/mcxt.c | modified | +37 −0 |
| src/common/fe_memutils.c | modified | +32 −11 |
| src/include/common/fe_memutils.h | modified | +15 −1 |
| src/include/utils/palloc.h | modified | +1 −0 |