Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit368d7f3

Browse files
committed
Add parens to ConvertToXSegs macro
The current definition is dangerous. No bugs exist in our code atpresent, but backpatch to 11 nonetheless where it was introduced.Author: Álvaro Herrera <alvherre@alvh.no-ip.org>
1 parenta3554b2 commit368d7f3

File tree

1 file changed

+5
-2
lines changed
  • src/backend/access/transam

1 file changed

+5
-2
lines changed

‎src/backend/access/transam/xlog.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -760,9 +760,12 @@ static ControlFileData *ControlFile = NULL;
760760
*/
761761
#defineUsableBytesInPage (XLOG_BLCKSZ - SizeOfXLogShortPHD)
762762

763-
/* Convert values of GUCs measured in megabytes to equiv. segment count */
763+
/*
764+
* Convert values of GUCs measured in megabytes to equiv. segment count.
765+
* Rounds down.
766+
*/
764767
#defineConvertToXSegs(x,segsize)\
765-
(x / ((segsize) / (1024 * 1024)))
768+
((x) / ((segsize) / (1024 * 1024)))
766769

767770
/* The number of bytes in a WAL segment usable for WAL data. */
768771
staticintUsableBytesInSegment;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp