mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
gh-112532: Require mimalloc in --disable-gil
builds (gh-112883)
This commit is contained in:
parent
fed294c645
commit
fdee7b7b3e
10 changed files with 76 additions and 12 deletions
|
@ -738,6 +738,8 @@ class CmdLineTest(unittest.TestCase):
|
|||
out = self.run_xdev("-c", code, check_exitcode=False)
|
||||
if support.with_pymalloc():
|
||||
alloc_name = "pymalloc_debug"
|
||||
elif support.Py_GIL_DISABLED:
|
||||
alloc_name = "mimalloc_debug"
|
||||
else:
|
||||
alloc_name = "malloc_debug"
|
||||
self.assertEqual(out, alloc_name)
|
||||
|
@ -814,9 +816,13 @@ class CmdLineTest(unittest.TestCase):
|
|||
@support.cpython_only
|
||||
def test_pythonmalloc(self):
|
||||
# Test the PYTHONMALLOC environment variable
|
||||
malloc = not support.Py_GIL_DISABLED
|
||||
pymalloc = support.with_pymalloc()
|
||||
mimalloc = support.with_mimalloc()
|
||||
if pymalloc:
|
||||
if support.Py_GIL_DISABLED:
|
||||
default_name = 'mimalloc_debug' if support.Py_DEBUG else 'mimalloc'
|
||||
default_name_debug = 'mimalloc_debug'
|
||||
elif pymalloc:
|
||||
default_name = 'pymalloc_debug' if support.Py_DEBUG else 'pymalloc'
|
||||
default_name_debug = 'pymalloc_debug'
|
||||
else:
|
||||
|
@ -826,9 +832,12 @@ class CmdLineTest(unittest.TestCase):
|
|||
tests = [
|
||||
(None, default_name),
|
||||
('debug', default_name_debug),
|
||||
('malloc', 'malloc'),
|
||||
('malloc_debug', 'malloc_debug'),
|
||||
]
|
||||
if malloc:
|
||||
tests.extend([
|
||||
('malloc', 'malloc'),
|
||||
('malloc_debug', 'malloc_debug'),
|
||||
])
|
||||
if pymalloc:
|
||||
tests.extend((
|
||||
('pymalloc', 'pymalloc'),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue