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

Commita9baeb3

Browse files
committed
Can't completely get rid of #ifndef FRONTEND in palloc.h :-(
pg_controldata includes postgres.h not postgres_fe.h, so utils/palloc.hmust be able to compile in a "#define FRONTEND" context. It appears thatSolaris Studio is smart enough to persuade us to define PG_USE_INLINE,but not smart enough to not make a copy of unreferenced static functions;which leads to an unsatisfied reference to CurrentMemoryContext. So weneed an #ifndef FRONTEND around that declaration. Per buildfarm.
1 parent5035701 commita9baeb3

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

‎src/include/utils/palloc.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,14 @@ extern void *repalloc_huge(void *pointer, Size size);
7575
* MemoryContextSwitchTo can't be a macro in standard C compilers.
7676
* But we can make it an inline function if the compiler supports it.
7777
* See STATIC_IF_INLINE in c.h.
78+
*
79+
* Although this header file is nominally backend-only, certain frontend
80+
* programs like pg_controldata include it via postgres.h. For some compilers
81+
* it's necessary to hide the inline definition of MemoryContextSwitchTo in
82+
* this scenario; hence the #ifndef FRONTEND.
7883
*/
7984

85+
#ifndefFRONTEND
8086
#ifndefPG_USE_INLINE
8187
externMemoryContextMemoryContextSwitchTo(MemoryContextcontext);
8288
#endif/* !PG_USE_INLINE */
@@ -90,6 +96,7 @@ MemoryContextSwitchTo(MemoryContext context)
9096
returnold;
9197
}
9298
#endif/* PG_USE_INLINE || MCXT_INCLUDE_DEFINITIONS */
99+
#endif/* FRONTEND */
93100

94101
/*
95102
* These are like standard strdup() except the copied string is

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp