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,7 +1,9 @@
import contextlib
import os
import sys
import tracemalloc
import cosmo
if cosmo.MODE == "dbg":
import tracemalloc
import unittest
from unittest.mock import patch
from test.support.script_helper import (assert_python_ok, assert_python_failure,
@ -87,6 +89,7 @@ def traceback_filename(filename):
return traceback_lineno(filename, 0)
@unittest.skipUnless(cosmo.MODE == "dbg", "requires APE debug build")
class TestTracemallocEnabled(unittest.TestCase):
def setUp(self):
if tracemalloc.is_tracing():
@ -297,6 +300,7 @@ class TestTracemallocEnabled(unittest.TestCase):
self.assertEqual(exitcode, 0)
@unittest.skipUnless(cosmo.MODE == "dbg", "requires APE debug build")
class TestSnapshot(unittest.TestCase):
maxDiff = 4000
@ -591,6 +595,7 @@ class TestSnapshot(unittest.TestCase):
[])
@unittest.skipUnless(cosmo.MODE == "dbg", "requires APE debug build")
class TestFilters(unittest.TestCase):
maxDiff = 2048
@ -802,6 +807,7 @@ class TestFilters(unittest.TestCase):
self.assertFalse(f._match_traceback(unknown))
@unittest.skipUnless(cosmo.MODE == "dbg", "requires APE debug build")
class TestCommandLine(unittest.TestCase):
def test_env_var_disabled_by_default(self):
# not tracing by default
@ -874,6 +880,7 @@ class TestCommandLine(unittest.TestCase):
assert_python_ok('-X', 'tracemalloc', '-c', code)
@unittest.skipUnless(cosmo.MODE == "dbg", "requires APE debug build")
@unittest.skipIf(_testcapi is None, 'need _testcapi')
class TestCAPI(unittest.TestCase):
maxDiff = 80 * 20