Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eHzbz-0004Vn-RZ for pgsql-committers@arkaria.postgresql.org; Thu, 23 Nov 2017 22:04:47 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eHzbz-0001yI-EK for pgsql-committers@arkaria.postgresql.org; Thu, 23 Nov 2017 22:04:47 +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 1eHzbz-0001y8-9m for pgsql-committers@lists.postgresql.org; Thu, 23 Nov 2017 22:04:47 +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.89) (envelope-from ) id 1eHzbw-0007CR-00 for pgsql-committers@postgresql.org; Thu, 23 Nov 2017 22:04:46 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id vANM4aqL013548; Thu, 23 Nov 2017 17:04:36 -0500 From: Tom Lane To: Andres Freund cc: Tomas Vondra , Simon Riggs , pgsql-committers , Andrew Dunstan Subject: Re: pgsql: Generational memory allocator In-reply-to: <20171123214636.unwkrkunr7m2bkii@alap3.anarazel.de> References: <20171123001649.y2nf7422iay6cw3v@alap3.anarazel.de> <20171123193936.fncfnar5wkpx56mw@alap3.anarazel.de> <21043.1511467602@sss.pgh.pa.us> <20171123214636.unwkrkunr7m2bkii@alap3.anarazel.de> Comments: In-reply-to Andres Freund message dated "Thu, 23 Nov 2017 13:46:36 -0800" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <13546.1511474676.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Thu, 23 Nov 2017 17:04:36 -0500 Message-ID: <13547.1511474676@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Andres Freund writes: > On 2017-11-23 22:34:57 +0100, Tomas Vondra wrote: >> Hmmm, I see. Presumably adding this to GenerationChunk (similarly to wh= at we >> do in AllocChunkData) would address the issue: >> = >> #if MAXIMUM_ALIGNOF > 4 && SIZEOF_VOID_P =3D=3D 4 >> Size padding; >> #endif >> = >> but I have no way to verify that (no access to such machine). I wonder = why >> SlabChunk doesn't need to do that (perhaps a comment explaining that wo= uld >> be appropriate?). > Can't you just compile pg on a 32bit system and manually define MAXALIGN > to 8 bytes? I pushed a patch that computes how much padding to add and adds it. (It might not really work if size_t and void * are different sizes, because then there could be additional padding in the struct; but that seems very unlikely.) regards, tom lane