[New-bugs-announce] [issue5553] Py_LOCAL_INLINE(type) doesn't actually inline except using MSC

Daniel Stutzbach report at bugs.python.org
Tue Mar 24 15:49:19 CET 2009


New submission from Daniel Stutzbach <daniel at stutzbachenterprises.com>:

Below is the relevant snippet from pyport.h.  There are two reasons that
Py_LOCAL_INLINE doesn't actually emit the "inline" keyword (unless
compiling with MSC).  

First, "configure" does not have code to test the compiler and define
USE_INLINE if appropriate.

Second, the code undefines USE_INLINE even if defined! (oops? ;) )

The snippet is replicated with slightly different names near the top of
_sre.c.

#undef USE_INLINE /* XXX - set via configure? */

#if defined(_MSC_VER)
#if defined(PY_LOCAL_AGGRESSIVE)
/* enable more aggressive optimization for visual studio */
#pragma optimize("agtw", on)
#endif
/* ignore warnings if the compiler decides not to inline a function */
#pragma warning(disable: 4710)
/* fastest possible local call under MSVC */
#define Py_LOCAL(type) static type __fastcall
#define Py_LOCAL_INLINE(type) static __inline type __fastcall
#elif defined(USE_INLINE)
#define Py_LOCAL(type) static type
#define Py_LOCAL_INLINE(type) static inline type
#else
#define Py_LOCAL(type) static type
#define Py_LOCAL_INLINE(type) static type
#endif

----------
messages: 84089
nosy: stutzbach
severity: normal
status: open
title: Py_LOCAL_INLINE(type) doesn't actually inline except using MSC
versions: Python 2.7, Python 3.0, Python 3.1

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue5553>
_______________________________________


More information about the New-bugs-announce mailing list