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

Commitdbb3d6f

Browse files
committed
Add pg_attribute_always_inline.
Sometimes it is useful to be able to insist that the compiler inline afunction that its normal cost analysis would not normally choose to inline.This can be useful for instantiating different variants of a function thatremove branches of code by constant folding.Author: Thomas MunroReviewed-By: Andres FreundDiscussion:https://postgr.es/m/CAEepm=09rr65VN+cAV5FgyM_z=D77Xy8Fuc9CDDDYbq3pQUezg@mail.gmail.com
1 parent923e8de commitdbb3d6f

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

‎src/include/c.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,16 @@
146146
#definepg_attribute_noreturn()
147147
#endif
148148

149+
/* GCC, Sunpro and XLC support always_inline via __attribute__ */
150+
#if defined(__GNUC__)
151+
#definepg_attribute_always_inline __attribute__((always_inline))
152+
/* msvc via a special keyword */
153+
#elif defined(_MSC_VER)
154+
#definepg_attribute_always_inline __forceinline
155+
#else
156+
#definepg_attribute_always_inline
157+
#endif
158+
149159
/*
150160
* Forcing a function not to be inlined can be useful if it's the slow path of
151161
* a performance-critical function, or should be visible in profiles to allow

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp