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

Commita0247e7

Browse files
committed
Add pg_noinline macro to c.h.
Forcing a function not to be inlined can be useful if it's theslow-path of a performance critical function, or should be visible inprofiles to allow for proper cost attribution.Author: Andres FreundDiscussion:https://postgr.es/m/20170914061207.zxotvyopetm7lrrp@alap3.anarazel.de
1 parentd133982 commita0247e7

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

‎src/include/c.h

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -642,6 +642,22 @@ typedef NameData *Name;
642642
#definepg_attribute_noreturn()
643643
#endif
644644

645+
646+
/*
647+
* Forcing a function not to be inlined can be useful if it's the slow-path of
648+
* a performance critical function, or should be visible in profiles to allow
649+
* for proper cost attribution.
650+
*/
651+
/* GCC, Sunpro and XLC support noinline via __attribute */
652+
#if defined(__GNUC__)|| defined(__SUNPRO_C)|| defined(__IBMC__)
653+
#definepg_noinline __attribute__((noinline))
654+
/* msvc via declspec */
655+
#elif defined(_MSC_VER)
656+
#definepg_noinline __declspec(noinline)
657+
#else
658+
#definepg_noinline
659+
#endif
660+
645661
/* ----------------------------------------------------------------
646662
*Section 6:assertions
647663
* ----------------------------------------------------------------

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp