Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eWY3F-0001cX-H1 for pgsql-hackers@arkaria.postgresql.org; Wed, 03 Jan 2018 01:41:05 +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 1eWY3F-0000gm-3H for pgsql-hackers@arkaria.postgresql.org; Wed, 03 Jan 2018 01:41:05 +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 1eWY3E-0000gd-Pq for pgsql-hackers@lists.postgresql.org; Wed, 03 Jan 2018 01:41:04 +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.89) (envelope-from ) id 1eWY34-0004sF-0l for pgsql-hackers@lists.postgresql.org; Wed, 03 Jan 2018 01:41:03 +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 w031eoEk018302; Tue, 2 Jan 2018 20:40:50 -0500 From: Tom Lane To: Andres Freund cc: Thomas Munro , pgsql-hackers@lists.postgresql.org Subject: Re: Ensuring hash tuples are properly maxaligned In-reply-to: <20180103013300.cf4jermw5ksygm7l@alap3.anarazel.de> References: <14483.1514938129@sss.pgh.pa.us> <20180103010931.6vsirlb5pdapdroq@alap3.anarazel.de> <17454.1514942419@sss.pgh.pa.us> <20180103013300.cf4jermw5ksygm7l@alap3.anarazel.de> Comments: In-reply-to Andres Freund message dated "Tue, 02 Jan 2018 17:33:00 -0800" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <18300.1514943650.1@sss.pgh.pa.us> Date: Tue, 02 Jan 2018 20:40:50 -0500 Message-ID: <18301.1514943650@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Andres Freund writes: > On 2018-01-03 14:29:15 +1300, Thomas Munro wrote: >> On Wed, Jan 3, 2018 at 2:20 PM, Tom Lane wrote: >>> Andres Freund writes: >>> But note that dsa_pointer can be wider than a regular pointer on >>> platforms without atomics support. >>> Hm. I did not get that impression from the comments in dsa.h, >>> but if it's true then this approach won't work --- and indeed the >>> hash code would be actively broken in such a case, so it's a problem >>> we must fix. >> Maybe Andres is thinking of dsa_pointer_atomic? dsa_pointer is >> normally the size of a pointer (well, really, the size of size_t), >> though it could be *narrower* if you don't have atomics or ask for it >> with USE_SMALL_DSA_POINTER > Yep, I was. OK, then there's not a live bug, but I'm a bit tempted to get rid of the data[] member anyway. It's not clear to me now that keeping it results in net cleaner code. Thoughts? regards, tom lane