]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
GH-130396: Increase trashcan overhead (GH-130552)
authorMark Shannon <mark@hotpy.org>
Wed, 26 Feb 2025 08:54:24 +0000 (08:54 +0000)
committerGitHub <noreply@github.com>
Wed, 26 Feb 2025 08:54:24 +0000 (08:54 +0000)
Double trashcan overhead

Include/cpython/object.h

index f466091e07e465c116ba7051544b5b6552eafdbe..70cf0b51f140a927dd0c61455995488a64ca1f30 100644 (file)
@@ -494,13 +494,13 @@ PyAPI_FUNC(int) _Py_ReachedRecursionLimitWithMargin(PyThreadState *tstate, int m
 #define Py_TRASHCAN_BEGIN(op, dealloc) \
 do { \
     PyThreadState *tstate = PyThreadState_Get(); \
-    if (_Py_ReachedRecursionLimitWithMargin(tstate, 1) && Py_TYPE(op)->tp_dealloc == (destructor)dealloc) { \
+    if (_Py_ReachedRecursionLimitWithMargin(tstate, 2) && Py_TYPE(op)->tp_dealloc == (destructor)dealloc) { \
         _PyTrash_thread_deposit_object(tstate, (PyObject *)op); \
         break; \
     }
     /* The body of the deallocator is here. */
 #define Py_TRASHCAN_END \
-    if (tstate->delete_later && !_Py_ReachedRecursionLimitWithMargin(tstate, 2)) { \
+    if (tstate->delete_later && !_Py_ReachedRecursionLimitWithMargin(tstate, 4)) { \
         _PyTrash_thread_destroy_chain(tstate); \
     } \
 } while (0);