Re: Patch: Remove gcc dependency in definition of inline functions - Mailing list pgsql-hackers

From Kurt Harriman
Subject Re: Patch: Remove gcc dependency in definition of inline functions
Date
Msg-id 4B276FC3.1010108@acm.org
Whole thread Raw
In response to Patch: Remove gcc dependency in definition of inline functions  (Kurt Harriman <harriman@acm.org>)
Responses Re: Patch: Remove gcc dependency in definition of inline functions  (Marko Kreen <markokr@gmail.com>)
Re: Patch: Remove gcc dependency in definition of inline functions  (Kurt Harriman <harriman@acm.org>)
List pgsql-hackers
Hi,

Attached is a revised patch, offered for the 2010-01 commitfest.
It's also available in my git repository in the "submitted" branch:
  http://git.postgresql.org/gitweb?p=users/harriman/share.git;a=shortlog;h=refs/heads/submitted

In this version, the "configure" script tests whether a static
inline function can be defined without incurring a warning when
not referenced.  If successful, the preprocessor symbol PG_INLINE
is defined in pg_config.h to the appropriate keyword: inline,
__inline, __inline__, or __forceinline.  Otherwise PG_INLINE
remains undefined.

palloc.h and pg_list.h condition their inline function
definitions on PG_INLINE instead of the gcc-specific __GNUC__.
Thus the functions can be inlined on more platforms, not only
gcc.

Ordinary out-of-line calls are still used if the compiler doesn't
recognize inline functions, or spews warnings when static inline
functions are defined but not referenced.

Regards,
... kurt




Attachment

pgsql-hackers by date:

Previous
From: Boszormenyi Zoltan
Date:
Subject: Re: ECPG patch 3, DESCRIBE [OUTPUT] support
Next
From: Hiroyuki Yamada
Date:
Subject: An example of bugs for Hot Standby