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

Commit56dffb5

Browse files
committed
Turn special page pointer validation to static inline function
Inclusion of multiple macros inside another macro was pushing MSVCpast its size liimit. Reported by buildfarm.
1 parent1ff3f42 commit56dffb5

File tree

1 file changed

+20
-3
lines changed

1 file changed

+20
-3
lines changed

‎src/include/storage/bufpage.h

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -297,15 +297,32 @@ typedef PageHeaderData *PageHeader;
297297
#definePageGetSpecialSize(page) \
298298
((uint16) (PageGetPageSize(page) - ((PageHeader)(page))->pd_special))
299299

300+
/*
301+
* Using assertions, validate that the page special pointer is OK.
302+
*
303+
* This is intended to catch use of the pointer before page initialization.
304+
* It is implemented as a function do to the limitations of the MSVC compiler,
305+
* which choked on doing all these tests within another macro. We return true
306+
* so that MacroAssert() can be used while still getting the specifics from
307+
* the macro failure within this function.
308+
*/
309+
staticinlinebool
310+
PageValidateSpecialPointer(Pagepage)
311+
{
312+
Assert(PageIsValid(page));
313+
Assert(((PageHeader) (page))->pd_special <=BLCKSZ);
314+
Assert(((PageHeader) (page))->pd_special >=SizeOfPageHeaderData);
315+
316+
return true;
317+
}
318+
300319
/*
301320
* PageGetSpecialPointer
302321
*Returns pointer to special space on a page.
303322
*/
304323
#definePageGetSpecialPointer(page) \
305324
( \
306-
AssertMacro(PageIsValid(page)), \
307-
AssertMacro(((PageHeader) (page))->pd_special <= BLCKSZ), \
308-
AssertMacro(((PageHeader) (page))->pd_special >= SizeOfPageHeaderData), \
325+
AssertMacro(PageValidateSpecialPointer(page)), \
309326
(char *) ((char *) (page) + ((PageHeader) (page))->pd_special) \
310327
)
311328

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp