Re: define pg_structiszero(addr, s, r) - Mailing list pgsql-hackers

From Ranier Vilela
Subject Re: define pg_structiszero(addr, s, r)
Date
Msg-id CAEudQArxZZk2YiZ8nvGym26yTtNoCiS6bTtmdWq1QvKayevOZQ@mail.gmail.com
Whole thread Raw
In response to Re: define pg_structiszero(addr, s, r)  (Bertrand Drouvot <bertranddrouvot.pg@gmail.com>)
Responses Re: define pg_structiszero(addr, s, r)
List pgsql-hackers

Em qui., 14 de nov. de 2024 às 07:09, Bertrand Drouvot <bertranddrouvot.pg@gmail.com> escreveu:
Hi,

On Thu, Nov 14, 2024 at 09:27:06AM +0900, Michael Paquier wrote:
> Makes sense to me to just do that, with a first < 8 loop, and a second
> for the 8~63 range.

Thanks for looking at it!

> There is also a "cant'" in the last size_t check.  Simple typo.

Please find attached v12, with more comments and comments changes to explain
the multiple cases (for safety) and phases (for efficiency).
Is it worth mentioning that pg_memory_is_all_zeros does not work correctly on 32-bit systems?

(63 < (size_t) * 8) /* 63 - 32*/

Or do we adjust magic constants according to 32/64 bit?

best regards,
Ranier Vilela

pgsql-hackers by date:

Previous
From: Aleksander Alekseev
Date:
Subject: Re: [PATCH] Refactor SLRU to always use long file names
Next
From: jian he
Date:
Subject: Re: altering a column's collation leaves an invalid foreign key