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

From Bertrand Drouvot
Subject Re: define pg_structiszero(addr, s, r)
Date
Msg-id ZzRKBKgxgiF+GVry@ip-10-97-1-34.eu-west-3.compute.internal
Whole thread Raw
In response to Re: define pg_structiszero(addr, s, r)  (David Rowley <dgrowleyml@gmail.com>)
List pgsql-hackers
Hi,

On Tue, Nov 12, 2024 at 01:32:36PM -0300, Ranier Vilela wrote:
> It seems to me that it is enough to protect the SIMD loop when the size is
> smaller.
> 
>     if (len > sizeof(size_t) * 8)
>     {
>       for (; p < aligned_end - (sizeof(size_t) * 7); p += sizeof(size_t) *
> 8)
>       {
>           if ((((size_t *) p)[0] != 0) | (((size_t *) p)[1] != 0) |
>               (((size_t *) p)[2] != 0) | (((size_t *) p)[3] != 0) |
>               (((size_t *) p)[4] != 0) | (((size_t *) p)[5] != 0) |
>               (((size_t *) p)[6] != 0) | (((size_t *) p)[7] != 0))
>               return false;
>       }
>     }
> 
> See v1_allzeros_small.c attached.

Thanks for looking at it!

It's not enough, as that would not fix the second reason mentioned in [1].


[1]: https://www.postgresql.org/message-id/ZzLxAJuGzyqA7cUo%40ip-10-97-1-34.eu-west-3.compute.internal 


Regards,

-- 
Bertrand Drouvot
PostgreSQL Contributors Team
RDS Open Source Databases
Amazon Web Services: https://aws.amazon.com



pgsql-hackers by date:

Previous
From: Amit Kapila
Date:
Subject: Re: Disallow UPDATE/DELETE on table with unpublished generated column as REPLICA IDENTITY
Next
From: Peter Eisentraut
Date:
Subject: Re: Enable data checksums by default