Re: missing PG_IO_ALIGN_SIZE uses - Mailing list pgsql-hackers

From Peter Eisentraut
Subject Re: missing PG_IO_ALIGN_SIZE uses
Date
Msg-id cbc3cfff-3dd0-4649-a14f-93fd5bf873e6@eisentraut.org
Whole thread Raw
In response to Re: missing PG_IO_ALIGN_SIZE uses  (Chao Li <li.evan.chao@gmail.com>)
List pgsql-hackers
On 02.12.25 02:11, Chao Li wrote:
>>
<0001-Use-PG_IO_ALIGN_SIZE-for-aligning-WAL-buffers.patch><0002-Use-PGAlignedXLogBlock-in-BootStrapXLOG.patch><0003-pg_test_fsync-Align-test-data-using-PGAlignedXLogBlo.patch>
> Overall the patch looks good to me:

I have committed these all as one patch.  Initially I thought the first 
patch might be worth backpatching, but it seems that's not needed.

> 0001 fixes two overlooked alignment to PG_IO_ALIGN_SIZE
> 0002 switches BootStrapXLOG to use PGAlignedXLogBlock, which is aligned to PG_IO_ALIGN_SIZE
> 0003 does the same for pg_test_fsync
> 
> My only nit comment is in 0002:
> ```
> -    memset(page, 0, XLOG_BLCKSZ);
> +    memset(&buffer, 0, sizeof buffer);
> ```
> 
> I know “sizeof” is an operator instead of a function, “sizeof buffer” is grammatically correct. However, most of
placesdo “sizeof(buffer)”, so unless we want to prompt the syntax of “sizeof buffer” (without the braces), it’s better
tokeep a consistent syntax.
 

The style without parentheses is not non-existent in PostgreSQL code, so 
I think we can use it when appropriate.




pgsql-hackers by date:

Previous
From: Pavel Stehule
Date:
Subject: Re: proposal: schema variables
Next
From: Tom Lane
Date:
Subject: Re: Make copyObject work in C++