pgsql: Invent a memory context reset/delete callback mechanism. - Mailing list pgsql-committers

From Tom Lane
Subject pgsql: Invent a memory context reset/delete callback mechanism.
Date
Msg-id E1YRTDR-0004to-LH@gemulon.postgresql.org
Whole thread Raw
Responses Re: pgsql: Invent a memory context reset/delete callback mechanism.
Re: pgsql: Invent a memory context reset/delete callback mechanism.
List pgsql-committers
Invent a memory context reset/delete callback mechanism.

This allows cleanup actions to be registered to be called just before a
particular memory context's contents are flushed (either by deletion or
MemoryContextReset).  The patch in itself has no use-cases for this, but
several likely reasons for wanting this exist.

In passing, per discussion, rearrange some boolean fields in struct
MemoryContextData so as to avoid wasted padding space.  For safety,
this requires making allowInCritSection's existence unconditional;
but I think that's a better approach than what was there anyway.

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/f65e8270587f3e9b8224e20f7d020ed1f816dfe1

Modified Files
--------------
src/backend/utils/mmgr/mcxt.c |   71 ++++++++++++++++++++++++++++++++++++-----
src/include/nodes/memnodes.h  |   24 +++++++++++---
src/include/utils/memutils.h  |    2 ++
3 files changed, 85 insertions(+), 12 deletions(-)


pgsql-committers by date:

Previous
From: Alvaro Herrera
Date:
Subject: pgsql: Fix a couple of trivial issues in jsonb.c
Next
From: Alvaro Herrera
Date:
Subject: pgsql: Make CREATE OR REPLACE VIEW internally more consistent