pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: John Naylor <john.naylor@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Get rid of radix tree's general purpose memory context
Date: Mon, 06 Jan 2025 04:46:09 +0000
Message-ID: <E1tUf0C-0005eS-UA@gemulon.postgresql.org> (raw)

Get rid of radix tree's general purpose memory context

Previously, this was notionally used only for the entry point of the
tree and as a convenient parent for other contexts.

For shared memory, the creator previously allocated the entry point
in this context, but attaching backends didn't have access to that,
so they just used the caller's context. For the sake of consistency,
allocate every instance of an entry point in the caller's context.

For local memory, allocate the control object in the caller's context
as well. This commit also makes the "leaf context" the notional parent
of the child contexts used for nodes, so it's a bit of a misnomer,
but a future commit will make the node contexts independent rather
than children, so leave it this way for now to avoid code churn.

The memory context parameter for RT_CREATE is now unused in the case
of shared memory, so remove it and adjust callers to match.

In passing, remove unused "context" member from struct TidStore,
which seems to have been an oversight.

Reviewed by Masahiko Sawada

Discussion: https://postgr.es/m/CANWCAZZDCo4k5oURg_pPxM6+WZ1oiG=sqgjmQiELuyP0Vtrwig@mail.gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/e8a6f1f908d03b836c8b5379b449346ad32c1ba1

Modified Files
--------------
src/backend/access/common/tidstore.c             | 26 +++++---------
src/include/lib/radixtree.h                      | 35 ++++++++----------
src/test/modules/test_radixtree/test_radixtree.c | 45 ++++++++++--------------
3 files changed, 41 insertions(+), 65 deletions(-)



Message-ID: <E1tUf0C-0005eS-UA@gemulon.postgresql.org>
Permalink:  ../E1tUf0C-0005eS-UA@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1tUf0C-0005eS-UA@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-committers@postgresql.org
  Cc: john.naylor@postgresql.org, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: Get rid of radix tree's general purpose memory context
  In-Reply-To: <E1tUf0C-0005eS-UA@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox