Commit 368d7f32 authored by Alvaro Herrera's avatar Alvaro Herrera

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>
parent a3554b2d
...@@ -760,9 +760,12 @@ static ControlFileData *ControlFile = NULL; ...@@ -760,9 +760,12 @@ static ControlFileData *ControlFile = NULL;
*/ */
#define UsableBytesInPage (XLOG_BLCKSZ - SizeOfXLogShortPHD) #define UsableBytesInPage (XLOG_BLCKSZ - SizeOfXLogShortPHD)
/* Convert values of GUCs measured in megabytes to equiv. segment count */ /*
* Convert values of GUCs measured in megabytes to equiv. 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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment