mirror of
https://github.com/python/cpython.git
synced 2025-12-23 09:19:18 +00:00
[3.10] gh-94841: Ensure arena_map_get() is inlined in PyObject_Free() (GH-94842)
Need to define ALWAYS_INLINE macro for 3.10. Co-authored-by: neonene <53406459+neonene@users.noreply.github.com>
This commit is contained in:
parent
1cf0305ba5
commit
5d26f85521
2 changed files with 12 additions and 1 deletions
|
|
@ -0,0 +1 @@
|
|||
Fix the possible performance regression of :c:func:`PyObject_Free` compiled with MSVC version 1932.
|
||||
|
|
@ -1397,9 +1397,19 @@ static int arena_map_bot_count;
|
|||
static arena_map_bot_t arena_map_root;
|
||||
#endif
|
||||
|
||||
#if defined(Py_DEBUG)
|
||||
# define ALWAYS_INLINE
|
||||
#elif defined(__GNUC__) || defined(__clang__) || defined(__INTEL_COMPILER)
|
||||
# define ALWAYS_INLINE __attribute__((always_inline))
|
||||
#elif defined(_MSC_VER)
|
||||
# define ALWAYS_INLINE __forceinline
|
||||
#else
|
||||
# define ALWAYS_INLINE
|
||||
#endif
|
||||
|
||||
/* Return a pointer to a bottom tree node, return NULL if it doesn't exist or
|
||||
* it cannot be created */
|
||||
static arena_map_bot_t *
|
||||
static ALWAYS_INLINE arena_map_bot_t *
|
||||
arena_map_get(block *p, int create)
|
||||
{
|
||||
#ifdef USE_INTERIOR_NODES
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue