Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iigGs-0002WU-D1 for pgsql-bugs@arkaria.postgresql.org; Sat, 21 Dec 2019 15:02:22 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1iigGq-000835-6c for pgsql-bugs@arkaria.postgresql.org; Sat, 21 Dec 2019 15:02:20 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iigGp-00080E-Mj for pgsql-bugs@lists.postgresql.org; Sat, 21 Dec 2019 15:02:19 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1iigGj-0001tq-3C for pgsql-bugs@lists.postgresql.org; Sat, 21 Dec 2019 15:02:18 +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 xBLF25S0012107; Sat, 21 Dec 2019 10:02:05 -0500 From: Tom Lane To: Thomas Munro cc: Tomas Vondra , Alvaro Herrera , Andres Freund , James Coleman , PostgreSQL mailing lists Subject: Re: BUG #16104: Invalid DSA Memory Alloc Request in Parallel Hash In-reply-to: References: <20191210173224.y5vaam6ep7pjmddt@development> <20191210173516.GA10987@alvherre.pgsql> <20191210183606.t26c5ypa7bmij3ph@development> <29716.1576905031@sss.pgh.pa.us> Comments: In-reply-to Thomas Munro message dated "Sat, 21 Dec 2019 20:43:05 +1300" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <12105.1576940525.1@sss.pgh.pa.us> Date: Sat, 21 Dec 2019 10:02:05 -0500 Message-ID: <12106.1576940525@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Thomas Munro writes: > Yeah, I suppose it would be nice to get something reusable out of this > rather than a local definition only. The other important > characteristic is the direction of rotation, so here's a version that > defines pg_rotate_right32() in pg_bitutils.h. In back-branches > without that header we could define it locally. That looks like a good approach. One thought is that you could rely on BITS_PER_BYTE from c.h, rather than CHAR_BIT; then you don't have to #include in bitutils.h, which seems like header creep we could do without. (I think most other places that want this constant use BITS_PER_BYTE, too.) regards, tom lane