postgresql/src
David Rowley 2c2eb0d6b2 Shrink memory contexts struct sizes
Here we reduce the block size fields in AllocSetContext, GenerationContext
and SlabContext from Size down to uint32.  Ever since c6e0fe1f2, blocks
for non-dedicated palloc chunks can no longer be larger than 1GB, so
there's no need to store the various block size fields as 64-bit values.
32 bits are enough to store 2^30.

Here we also further reduce the memory context struct sizes by getting rid
of the 'keeper' field which stores a pointer to the context's keeper
block.  All the context types which have this field always allocate the
keeper block in the same allocation as the memory context itself, so the
keeper block always comes right at the end of the context struct.  Add
some macros to calculate that address rather than storing it in the
context.

Overall, in AllocSetContext and GenerationContext, this saves 20 bytes on
64-bit builds which for ALLOCSET_SMALL_SIZES can sometimes mean the
difference between having to allocate a 2nd block and storing all the
required allocations on the keeper block alone.  Such contexts are used
in relcache to store cache entries for indexes, of which there can be
a large number in a single backend.

Author: Melih Mutlu
Reviewed-by: David Rowley
Discussion: https://postgr.es/m/CAGPVpCSOW3uJ1QJmsMR9_oE3X7fG_z4q0AoU4R_w+2RzvroPFg@mail.gmail.com
2023-07-17 11:16:56 +12:00
..
backend Shrink memory contexts struct sizes 2023-07-17 11:16:56 +12:00
bin Simplify option handling in pg_ctl. 2023-07-14 12:35:54 -07:00
common Generate automatically code and documentation related to wait events 2023-07-05 10:53:11 +09:00
fe_utils Handle \v as a whitespace character in parsers 2023-07-06 08:16:24 +09:00
include Allow plan nodes with initPlans to be considered parallel-safe. 2023-07-14 11:41:20 -04:00
interfaces Remove --disable-thread-safety and related code. 2023-07-12 08:20:43 +12:00
makefiles Remove --disable-thread-safety and related code. 2023-07-12 08:20:43 +12:00
pl Translation updates 2023-06-26 12:02:02 +02:00
port Teach in-tree getopt_long() to move non-options to the end of argv. 2023-07-12 20:34:39 -07:00
template Use unnamed POSIX semaphores on Cygwin. 2023-01-06 10:33:28 +13:00
test Allow plan nodes with initPlans to be considered parallel-safe. 2023-07-14 11:41:20 -04:00
timezone Pre-beta mechanical code beautification. 2023-05-19 17:24:48 -04:00
tools pg_bsd_indent: Collect test diffs in test.diffs instead of tests.diff 2023-07-12 16:26:02 -07:00
tutorial Pre-beta mechanical code beautification. 2023-05-19 17:24:48 -04:00
.gitignore
DEVELOPERS
Makefile Integrate pg_bsd_indent into our build/test infrastructure. 2023-02-12 12:22:21 -05:00
Makefile.global.in Remove --disable-thread-safety and related code. 2023-07-12 08:20:43 +12:00
Makefile.shlib autoconf: Rely on ar supporting index creation 2022-10-07 11:53:39 -07:00
meson.build Integrate pg_bsd_indent into our build/test infrastructure. 2023-02-12 12:22:21 -05:00
nls-global.mk Fix for make unportability 2022-07-13 09:15:01 +02:00