[COMMITTERS] pgsql: Reduce size of common allocation header. - Mailing list pgsql-committers

From Andres Freund
Subject [COMMITTERS] pgsql: Reduce size of common allocation header.
Date
Msg-id E1civgT-0006NI-Ho@gemulon.postgresql.org
Whole thread Raw
List pgsql-committers
Reduce size of common allocation header.

The new slab allocator needs different per-allocation information than
the classical aset.c.  The definition in 58b25e981 wasn't sufficiently
careful on 32 platforms with 8 byte alignment, leading to buildfarm
failures.  That's not entirely easy to fix by just adjusting the
definition.

As slab.c doesn't actually need the size part(s) of the common header,
all chunks are equally sized after all, it seems better to instead
reduce the header to the part needed by all allocators, namely which
context an allocation belongs to. That has the advantage of reducing
the overhead of slab allocations, and also allows for more flexibility
in future allocators.

To avoid spreading the logic about accessing a chunk's context around,
centralize it in GetMemoryChunkContext(), which allows to delete a
good number of lines.

A followup commit will revise the mmgr/README portion about
StandardChunkHeader, and more.

Author: Andres Freund
Discussion: https://postgr.es/m/20170228074420.aazv4iw6k562mnxg@alap3.anarazel.de

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/7e3aa03b418d604d33040ed8fb866857dae82a02

Modified Files
--------------
src/backend/utils/mmgr/aset.c    |  48 +++++++---------
src/backend/utils/mmgr/mcxt.c    | 121 +++------------------------------------
src/backend/utils/mmgr/slab.c    |  87 ++++++++++------------------
src/include/utils/memutils.h     |  58 ++++++++++++-------
src/tools/pgindent/typedefs.list |   1 -
5 files changed, 97 insertions(+), 218 deletions(-)


pgsql-committers by date:

Previous
From: Andres Freund
Date:
Subject: Re: [COMMITTERS] pgsql: Make useful infrastructure from aset.cgenerally available.
Next
From: Andres Freund
Date:
Subject: [COMMITTERS] pgsql: Fix assertion failure due to over-eager code deduplication.