Skip to content

Commit 6b3f14e

Browse files
committed
Py3.14 w/JIT: Fix leakchecks.
Py3.14 with the JIT enabled creates new 'uop_executor' objects as code gets jitted. There's nothing we can do about these (right? They're attached to code objects), so don't count them as leaking. Fixes #455 and fixes #460
1 parent 74a65bd commit 6b3f14e

File tree

1 file changed

+18
-1
lines changed

1 file changed

+18
-1
lines changed

src/greenlet/tests/leakcheck.py

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,18 @@ class _RefCountChecker(object):
136136
# presumably.
137137
IGNORED_TYPES = () #(tuple, dict, types.FrameType, types.TracebackType)
138138

139+
# Names of types that should be ignored. Use this when we cannot
140+
# or don't want to import the class directly.
141+
IGNORED_TYPE_NAMES = (
142+
# This appears in Python3.14 with the JIT enabled. It
143+
# doesn't seem to be directly exposed to Python; the only way to get
144+
# one is to cause code to get jitted and then look for all objects
145+
# and find one with this name. But they multiply as code
146+
# executes and gets jitted, in ways we don't want to rely on.
147+
# So just ignore it.
148+
'uop_executor',
149+
)
150+
139151
def __init__(self, testcase, function):
140152
self.testcase = testcase
141153
self.function = function
@@ -179,9 +191,14 @@ def _include_object_p(self, obj):
179191
return False
180192

181193

182-
if kind in self.ignored_types or kind in self.IGNORED_TYPES:
194+
if (
195+
kind in self.ignored_types
196+
or kind in self.IGNORED_TYPES
197+
or kind.__name__ in self.IGNORED_TYPE_NAMES
198+
):
183199
return False
184200

201+
185202
return True
186203

187204
def _growth(self):

0 commit comments

Comments
 (0)