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

Commit013d324

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 parentd3d8755 commit013d324

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
@@ -744,9 +744,12 @@ static ControlFileData *ControlFile = NULL;
744744
*/
745745
#defineUsableBytesInPage (XLOG_BLCKSZ - SizeOfXLogShortPHD)
746746

747-
/* Convert min_wal_size_mb and max wal_size_mb to equivalent segment count */
747+
/*
748+
* Convert min_wal_size_mb and max wal_size_mb to equivalent segment count.
749+
* Rounds down.
750+
*/
748751
#defineConvertToXSegs(x,segsize)\
749-
(x / ((segsize) / (1024 * 1024)))
752+
((x) / ((segsize) / (1024 * 1024)))
750753

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

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp