File tree Expand file tree Collapse file tree 2 files changed +7
-5
lines changed Expand file tree Collapse file tree 2 files changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -249,7 +249,7 @@ _green_dealloc_kill_started_non_main_greenlet(BorrowedGreenlet self)
249249
250250 PyObject_GC_Track ((PyObject*)self);
251251
252- _Py_DEC_REFTOTAL ;
252+ GREENLET_Py_DEC_REFTOTAL ;
253253#ifdef COUNT_ALLOCS
254254 --Py_TYPE (self)->tp_frees ;
255255 --Py_TYPE (self)->tp_allocs ;
Original file line number Diff line number Diff line change @@ -73,20 +73,22 @@ Greenlet won't compile on anything older than Python 3.11 alpha 4 (see
7373# define Py_SET_REFCNT (obj, refcnt ) Py_REFCNT(obj) = (refcnt)
7474#endif
7575
76- #ifndef _Py_DEC_REFTOTAL
76+ #ifdef _Py_DEC_REFTOTAL
77+ # define GREENLET_Py_DEC_REFTOTAL _Py_DEC_REFTOTAL
78+ #else
7779/* _Py_DEC_REFTOTAL macro has been removed from Python 3.9 by:
7880 https://github.com/python/cpython/commit/49932fec62c616ec88da52642339d83ae719e924
7981
8082 The symbol we use to replace it was removed by at least 3.12.
8183*/
8284# ifdef Py_REF_DEBUG
8385# if GREENLET_PY312
84- # define _Py_DEC_REFTOTAL
86+ # define GREENLET_Py_DEC_REFTOTAL
8587# else
86- # define _Py_DEC_REFTOTAL _Py_RefTotal--
88+ # define GREENLET_Py_DEC_REFTOTAL _Py_RefTotal--
8789# endif
8890# else
89- # define _Py_DEC_REFTOTAL
91+ # define GREENLET_Py_DEC_REFTOTAL
9092# endif
9193#endif
9294// Define these flags like Cython does if we're on an old version.
You can’t perform that action at this time.
0 commit comments