Mostly-cosmetic improvements in memory chunk header alignment coding.

Tom Lane <tgl@sss.pgh.pa.us>

Commit: f65d21b258085bdc8ef2cc282ab1ff12da9c595c
Author: Tom Lane <tgl@sss.pgh.pa.us>
Date: 2017-11-24T20:50:22Z
Releases: 11.0
Mostly-cosmetic improvements in memory chunk header alignment coding.

Add commentary about what we're doing and why.  Apply the method used for
padding in GenerationChunk to AllocChunkData, replacing the rather ad-hoc
solution used in commit 7e3aa03b4.  Reorder fields in GenerationChunk so
that the padding calculation will work even if sizeof(size_t) is different
from sizeof(void *) --- likely that will never happen, but we don't need
the assumption if we do it like this.  Improve static assertions about
alignment.

In passing, fix a couple of oversights in the "large chunk" path in
GenerationAlloc().

Discussion: https://postgr.es/m/E1eHa4J-0006hI-Q8@gemulon.postgresql.org

Files

PathChange+/−
src/backend/utils/mmgr/aset.c modified +20 −5
src/backend/utils/mmgr/generation.c modified +27 −31
src/backend/utils/mmgr/slab.c modified +15 −6

Discussion

Cited messages not in the archive: E1eHa4J-0006hI-Q8@gemulon.postgresql.org