On Thu, Oct 31, 2024 at 07:55:45AM +1100, Peter Smith wrote:
> +/*
> + * Test if a memory region starting at p and of size len is full of zeroes.
> + */
> +static inline bool
> +pg_mem_is_all_zeros(const void *ptr, size_t len)
> 
> The function comment should say 'ptr' instead of 'p', right?

Yes.

+static inline bool
+pg_mem_is_all_zeros(const void *ptr, size_t len)

While we're talking about wordsmithing things, I would not choose
"mem" for this routine, just stick to "memory".  There is not much in
the code that does memory-specific things like what you are proposing
here.  Still, this would be more consistent with the macros for memory 
barriers at least.  Hence, "pg_memory_is_all_zeros()" makes more
sense?

The location of memutils.h is sensible.

+   if (pg_mem_is_all_zeros(pagebytes , (BLCKSZ / sizeof(size_t))))

Extra space not required after pagebytes.
--
Michael

Attachment: signature.asc
Description: PGP signature

Reply via email to