Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ciaNp-0001V2-In for pgsql-hackers@arkaria.postgresql.org; Tue, 28 Feb 2017 05:31:33 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1ciaNo-00043R-SO for pgsql-hackers@arkaria.postgresql.org; Tue, 28 Feb 2017 05:31:32 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1ciaMJ-0001NY-4u for pgsql-hackers@postgresql.org; Tue, 28 Feb 2017 05:29:59 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1ciaMC-0003KF-7z for pgsql-hackers@postgresql.org; Tue, 28 Feb 2017 05:29:58 +0000 Received: from pro.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id v1S5Tk2D021137; Tue, 28 Feb 2017 00:29:46 -0500 From: Tom Lane To: Andres Freund cc: Tomas Vondra , Petr Jelinek , Petr Jelinek , Robert Haas , John Gorman , pgsql-hackers Subject: Re: PATCH: two slab-like memory allocators In-reply-to: <20170228051630.3qcevakcaaa6b4ef@alap3.anarazel.de> References: <20170227111732.vrx5v72ighehwpkf@alap3.anarazel.de> <20170227120200.5jc3ubg5jrqaznd7@alap3.anarazel.de> <26061.1488209545@sss.pgh.pa.us> <20170227155532.o7casczq5parlmz4@alap3.anarazel.de> <20170227164828.akgzeg6ggl2v4x7s@alap3.anarazel.de> <12622.1488216468@sss.pgh.pa.us> <20170227174201.yrofai7neyp6shb2@alap3.anarazel.de> <20170228034232.4h7ouyhxq4lbbao2@alap3.anarazel.de> <1240.1488254244@sss.pgh.pa.us> <20170228051630.3qcevakcaaa6b4ef@alap3.anarazel.de> Comments: In-reply-to Andres Freund message dated "Mon, 27 Feb 2017 21:16:30 -0800" Date: Tue, 28 Feb 2017 00:29:44 -0500 Message-ID: <1671.1488259784@sss.pgh.pa.us> X-Pg-Spam-Score: -1.9 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-hackers Precedence: bulk Sender: pgsql-hackers-owner@postgresql.org Andres Freund writes: > Hm, that should be doable with something like > #if MAXIMUM_ALIGNOF > 4 && SIZEOF_VOID_P == 4 > which'd probably be better documentation than a macro that hides this > (arguing internally whether SIZEOF_VOID_P or SIZEOF_SIZE_T) is better. Not sure either, but suggest we add a StaticAssert asserting there's no padding; something along the lines of offsetof(AllocSetChunkHeader, context) + sizeof(MemoryContext) == MAXALIGN(sizeof(AllocSetChunkHeader)) regards, tom lane -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers