mirror of
https://git.postgresql.org/git/postgresql.git
synced 2024-09-08 21:49:21 +02:00
Add parens to ConvertToXSegs macro
The current definition is dangerous. No bugs exist in our code at present, but backpatch to 11 nonetheless where it was introduced. Author: Álvaro Herrera <alvherre@alvh.no-ip.org>
This commit is contained in:
parent
d3d8755180
commit
013d324d51
@ -744,9 +744,12 @@ static ControlFileData *ControlFile = NULL;
|
|||||||
*/
|
*/
|
||||||
#define UsableBytesInPage (XLOG_BLCKSZ - SizeOfXLogShortPHD)
|
#define UsableBytesInPage (XLOG_BLCKSZ - SizeOfXLogShortPHD)
|
||||||
|
|
||||||
/* Convert min_wal_size_mb and max wal_size_mb to equivalent segment count */
|
/*
|
||||||
|
* Convert min_wal_size_mb and max wal_size_mb to equivalent segment count.
|
||||||
|
* Rounds down.
|
||||||
|
*/
|
||||||
#define ConvertToXSegs(x, segsize) \
|
#define ConvertToXSegs(x, segsize) \
|
||||||
(x / ((segsize) / (1024 * 1024)))
|
((x) / ((segsize) / (1024 * 1024)))
|
||||||
|
|
||||||
/* The number of bytes in a WAL segment usable for WAL data. */
|
/* The number of bytes in a WAL segment usable for WAL data. */
|
||||||
static int UsableBytesInSegment;
|
static int UsableBytesInSegment;
|
||||||
|
Loading…
Reference in New Issue
Block a user