Add palloc_extended for frontend and backend

Enterprise / PostgreSQL - Fujii Masao [postgresql.org] - 3 April 2015 03:36 UTC

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.

8c8a886 Add palloc_extended for frontend and backend.
src/backend/utils/mmgr/mcxt.c | 37 ++++++++++++++++++++++++++++++++
src/common/fe_memutils.c | 43 ++++++++++++++++++++++++++++----------
src/include/common/fe_memutils.h | 16 +++++++++++++-
src/include/utils/palloc.h | 1 +
4 files changed, 85 insertions(+), 12 deletions(-)

Upstream: git.postgresql.org


  • Share