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

Commit697e1d0

Browse files
committed
Define pg_attribute_cold and pg_attribute_hot macros
For compilers supporting __has_attribute and __has_attribute (hot/cold).__has_attribute is supported on gcc >= 5, clang >= 2.9 and icc >= 17.A followup commit will implement some usages of these macros.Author: David RowleyReviewed-by: Andres Freund, Peter EisentrautDiscussion:https://postgr.es/m/CAApHDvrVpasrEzLL2er7p9iwZFZ%3DJj6WisePcFeunwfrV0js_A%40mail.gmail.com
1 parent3b9b01f commit697e1d0

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
@@ -191,6 +191,22 @@
191191
#definepg_noinline
192192
#endif
193193

194+
/*
195+
* Marking certain functions as "hot" or "cold" can be useful to assist the
196+
* compiler in arranging the assembly code in a more efficient way.
197+
*/
198+
#if defined(__has_attribute)&&__has_attribute (cold)
199+
#definepg_attribute_cold __attribute__((cold))
200+
#else
201+
#definepg_attribute_cold
202+
#endif
203+
204+
#if defined(__has_attribute)&&__has_attribute (hot)
205+
#definepg_attribute_hot __attribute__((hot))
206+
#else
207+
#definepg_attribute_hot
208+
#endif
209+
194210
/*
195211
* Mark a point as unreachable in a portable fashion. This should preferably
196212
* be something that the compiler understands, to aid code generation.

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp