Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ciP72-0001rW-Ko for pgsql-hackers@arkaria.postgresql.org; Mon, 27 Feb 2017 17:29:28 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1ciP72-00017D-1Q for pgsql-hackers@arkaria.postgresql.org; Mon, 27 Feb 2017 17:29:28 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1ciP5Y-0006vz-0w for pgsql-hackers@postgresql.org; Mon, 27 Feb 2017 17:27:56 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1ciP5U-0006xh-VV for pgsql-hackers@postgresql.org; Mon, 27 Feb 2017 17:27:54 +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 v1RHRm6S012623; Mon, 27 Feb 2017 12:27:48 -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: <20170227164828.akgzeg6ggl2v4x7s@alap3.anarazel.de> References: <20170211013337.iw32bvfqwta634wy@alap3.anarazel.de> <53def906-2197-bc06-b987-d237f9574800@2ndquadrant.com> <20170214022221.obhdeyfn34h6hkwj@alap3.anarazel.de> <19464ac8-e66b-3598-858f-29c749bec35a@2ndquadrant.com> <20170224221038.43xf2cyonczzr6hb@alap3.anarazel.de> <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> Comments: In-reply-to Andres Freund message dated "Mon, 27 Feb 2017 08:48:28 -0800" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <12621.1488216468.1@sss.pgh.pa.us> Date: Mon, 27 Feb 2017 12:27:48 -0500 Message-ID: <12622.1488216468@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: > The best theory I have so far that I have is that slab.c's idea of > StandardChunkHeader's size doesn't match what mcxt.c think it is > (because slab.c simply embeds StandardChunkHeader, but mcxt uses > MAXALIGN(sizeof(StandardChunkHeader))). That's not good, but I don't > quite see how that'd cause the issue, since StandardChunkHeader's size > should always be properly sized. Uh, wrong. On a 32-bit machine with debug enabled, StandardChunkHeader will contain 3 4-byte fields. However, there are some such machines on which MAXALIGN is 8. For example, looking at termite's configure output: checking size of void *... 4 checking size of size_t... 4 checking size of long... 4 checking alignment of short... 2 checking alignment of int... 4 checking alignment of long... 4 checking alignment of long long int... 8 checking alignment of double... 8 axolotl's output looks similar. I expect my old HPPA dinosaur will show the failure as well. 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