Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bam16-000300-KW for pgsql-hackers@arkaria.postgresql.org; Fri, 19 Aug 2016 15:47:32 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1bam15-00038k-UI for pgsql-hackers@arkaria.postgresql.org; Fri, 19 Aug 2016 15:47:31 +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 1balzi-0001Zm-Uo for pgsql-hackers@postgresql.org; Fri, 19 Aug 2016 15:46:07 +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 1balzg-0007y1-4e for pgsql-hackers@postgresql.org; Fri, 19 Aug 2016 15:46:06 +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 u7JFk07D019066; Fri, 19 Aug 2016 11:46:00 -0400 From: Tom Lane To: Alexander Korotkov cc: pgsql-hackers Subject: Re: Should we cacheline align PGXACT? In-reply-to: References: <31991.1471614372@sss.pgh.pa.us> Comments: In-reply-to Alexander Korotkov message dated "Fri, 19 Aug 2016 17:50:03 +0300" Date: Fri, 19 Aug 2016 11:46:00 -0400 Message-ID: <19065.1471621560@sss.pgh.pa.us> X-Pg-Spam-Score: -2.5 (--) 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 Alexander Korotkov writes: > On Fri, Aug 19, 2016 at 4:46 PM, Tom Lane wrote: >> That's one mighty ugly patch. Can't you do it without needing to >> introduce the additional layer of struct nesting? > That's worrying me too. > We could use anonymous struct, but it seems to be prohibited in C89 which > we stick to. > Another idea, which comes to my mind, is to manually calculate size of > padding and insert it directly to PGXACT struct. But that seems rather > ugly too. However, it would be ugly definition not ugly usage... > Do you have better ideas? No, that was the best one that had occurred to me, too. You could probably introduce a StaticAssert that sizeof(PGXACT) is a power of 2 as a means of checking that the manual padding calculation hadn't gotten broken. 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