Fix Pyston speedups (#281)

We remove (i.e. hide behind a debug ifdef) the recursion checking methods,
and the memory hooks and memory allocator methods. ASAN mode has no
PYMALLOC, so we need a macro. Fix build break with des.c stack allocation.
This commit is contained in:
Gautham 2021-10-02 13:58:51 +05:30 committed by GitHub
parent 2fe8571010
commit 57f0eed382
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
42 changed files with 260 additions and 63 deletions

View file

@ -1,6 +1,7 @@
# Run the _testcapi module tests (tests for the Python/C API): by defn,
# these are all functions _testcapi exports whose name begins with 'test_'.
import cosmo
import os
import pickle
import random
@ -179,6 +180,7 @@ class CAPITest(unittest.TestCase):
o @= m1
self.assertEqual(o, ("matmul", 42, m1))
@unittest.skipUnless(cosmo.MODE == "dbg", "disabled recursion check")
def test_return_null_without_error(self):
# Issue #23571: A function must not return NULL without setting an
# error
@ -207,6 +209,7 @@ class CAPITest(unittest.TestCase):
'return_null_without_error.* '
'returned NULL without setting an error')
@unittest.skipUnless(cosmo.MODE == "dbg", "disabled recursion check")
def test_return_result_with_error(self):
# Issue #23571: A function must not return a result with an error set
if Py_DEBUG:
@ -242,6 +245,7 @@ class CAPITest(unittest.TestCase):
def test_buildvalue_N(self):
_testcapi.test_buildvalue_N()
@unittest.skipUnless(cosmo.MODE == "dbg", "disabled memory hooks")
def test_set_nomemory(self):
code = """if 1:
import _testcapi
@ -510,6 +514,7 @@ class Test_testcapi(unittest.TestCase):
if name.startswith('test_') and not name.endswith('_code'))
@unittest.skipUnless(cosmo.MODE == "dbg", "disabled memory debugging")
class PyMemDebugTests(unittest.TestCase):
PYTHONMALLOC = 'debug'
# '0x04c06e0' or '04C06E0'