]> granicus.if.org Git - python/commitdiff
Do a better job of not inlining Py_ADDRESS_IN_RANGE() for newer gcc's.
authorNeal Norwitz <nnorwitz@gmail.com>
Sun, 13 Nov 2005 18:55:39 +0000 (18:55 +0000)
committerNeal Norwitz <nnorwitz@gmail.com>
Sun, 13 Nov 2005 18:55:39 +0000 (18:55 +0000)
Perhaps Py_NO_INLINE should be moved to pyport.h or some other header?

Objects/obmalloc.c

index a6fdf408112cc57cefca685082d9977b66995f73..266b4c6031ae9d031a322d7cf82c3b882ca6b4d7 100644 (file)
@@ -557,8 +557,15 @@ error:
 
 #undef Py_ADDRESS_IN_RANGE
 
-/* Don't make static, to ensure this isn't inlined. */
-int Py_ADDRESS_IN_RANGE(void *P, poolp pool);
+#if defined(__GNUC__) && (__GNUC__ == 3) && (__GNUC_MINOR__ >= 1)
+#define Py_NO_INLINE __attribute__((__noinline__))
+#else
+#define Py_NO_INLINE
+#endif
+
+/* Don't make static, to try to ensure this isn't inlined. */
+int Py_ADDRESS_IN_RANGE(void *P, poolp pool) Py_NO_INLINE;
+#undef Py_NO_INLINE
 #endif
 
 /*==========================================================================*/