Re: Add bump memory context type and use it for tuplesorts
Tom Lane <tgl@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Tomas Vondra <tomas.vondra@enterprisedb.com>
Cc: David Rowley <dgrowleyml@gmail.com>,
Matthias van de Meent <boekewurm+postgres@gmail.com>,
Andres Freund <andres@anarazel.de>,
PostgreSQL Developers <pgsql-hackers@lists.postgresql.org>
Date: 2024-03-25T14:53:12Z
Lists: pgsql-hackers
Tomas Vondra <tomas.vondra@enterprisedb.com> writes: > IMHO the idea of having a general purpose memory context and then also > specialized memory contexts for particular allocation patterns is great, > and we should embrace it. Adding more and more special cases into > AllocSet seems to go directly against that idea, makes the code more > complex, and I don't quite see how is that better or easier to use than > having a separate BumpContext ... I agree with this completely. However, the current design for chunk headers is mighty restrictive about how many kinds of contexts we can have. We need to open that back up. Could we move the knowledge of exactly which context type it is out of the per-chunk header and keep it in the block header? This'd require that every context type have a standardized way of finding the block header from a chunk. We could repurpose the existing MemoryContextMethodID bits to allow having a small number of different ways, perhaps. regards, tom lane
Commits
-
Update mmgr's README to mention BumpContext
- 58cf2e120e8a 17.0 landed
-
Push dedicated BumpBlocks to the tail of the blocks list
- 6d2fd66b9908 17.0 landed
-
Improve test coverage in bump.c
- bea97cd02ebb 17.0 cited
-
Fix incorrect KeeperBlock macro in bump.c
- 705ec0565371 17.0 landed
-
Use bump memory context for tuplesorts
- 6ed83d5fa55c 17.0 landed
-
Introduce a bump memory allocator
- 29f6a959cfd8 17.0 landed
-
Enlarge bit-space for MemoryContextMethodID
- 0ba8b75e7ea6 17.0 landed