1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-17 06:41:09 +03:00

Convert MemoryContextSwitchTo() into an inline function when using GCC.

This commit is contained in:
Tom Lane
2005-02-18 21:52:34 +00:00
parent 477a64d9c8
commit a8593a3463
2 changed files with 28 additions and 2 deletions

View File

@ -14,7 +14,7 @@
*
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/utils/mmgr/mcxt.c,v 1.53 2004/12/31 22:02:48 pgsql Exp $
* $PostgreSQL: pgsql/src/backend/utils/mmgr/mcxt.c,v 1.54 2005/02/18 21:52:33 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@ -619,7 +619,13 @@ repalloc(void *pointer, Size size)
/*
* MemoryContextSwitchTo
* Returns the current context; installs the given context.
*
* This is inlined when using GCC.
*
* TODO: investigate supporting inlining for some non-GCC compilers.
*/
#ifndef __GNUC__
MemoryContext
MemoryContextSwitchTo(MemoryContext context)
{
@ -632,6 +638,8 @@ MemoryContextSwitchTo(MemoryContext context)
return old;
}
#endif /* ! __GNUC__ */
/*
* MemoryContextStrdup
* Like strdup(), but allocate from the specified context