Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit e5e5aa4

Browse files
committed
Do a better job of not inlining Py_ADDRESS_IN_RANGE() for newer gcc's.
Perhaps Py_NO_INLINE should be moved to pyport.h or some other header?
1 parent b6fc9df commit e5e5aa4

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

Objects/obmalloc.c

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -557,8 +557,15 @@ new_arena(void)
557557

558558
#undef Py_ADDRESS_IN_RANGE
559559

560-
/* Don't make static, to ensure this isn't inlined. */
561-
int Py_ADDRESS_IN_RANGE(void *P, poolp pool);
560+
#if defined(__GNUC__) && (__GNUC__ == 3) && (__GNUC_MINOR__ >= 1)
561+
#define Py_NO_INLINE __attribute__((__noinline__))
562+
#else
563+
#define Py_NO_INLINE
564+
#endif
565+
566+
/* Don't make static, to try to ensure this isn't inlined. */
567+
int Py_ADDRESS_IN_RANGE(void *P, poolp pool) Py_NO_INLINE;
568+
#undef Py_NO_INLINE
562569
#endif
563570

564571
/*==========================================================================*/

0 commit comments

Comments
 (0)