summaryrefslogtreecommitdiffstats
path: root/Lib/test/support/__init__.py
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2017-11-29 16:20:38 (GMT)
committerGitHub <noreply@github.com>2017-11-29 16:20:38 (GMT)
commit5d39e0429029324cae90bba2f19fb689b007c7d6 (patch)
treed414a4bc635c750d07c93d94835d932d3524c062 /Lib/test/support/__init__.py
parentc15bb49d71f97d400b295d88e5b075e89cb8ba20 (diff)
downloadcpython-5d39e0429029324cae90bba2f19fb689b007c7d6.zip
cpython-5d39e0429029324cae90bba2f19fb689b007c7d6.tar.gz
cpython-5d39e0429029324cae90bba2f19fb689b007c7d6.tar.bz2
bpo-32030: Rework memory allocators (#4625)
* Fix _PyMem_SetupAllocators("debug"): always restore allocators to the defaults, rather than only caling _PyMem_SetupDebugHooks(). * Add _PyMem_SetDefaultAllocator() helper to set the "default" allocator. * Add _PyMem_GetAllocatorsName(): get the name of the allocators * main() now uses debug hooks on memory allocators if Py_DEBUG is defined, rather than calling directly malloc() * Document default memory allocators in C API documentation * _Py_InitializeCore() now fails with a fatal user error if PYTHONMALLOC value is an unknown memory allocator, instead of failing with a fatal internal error. * Add new tests on the PYTHONMALLOC environment variable * Add support.with_pymalloc() * Add the _testcapi.WITH_PYMALLOC constant and expose it as support.with_pymalloc(). * sysconfig.get_config_var('WITH_PYMALLOC') doesn't work on Windows, so replace it with support.with_pymalloc(). * pythoninfo: add _testcapi collector for pymem
Diffstat (limited to 'Lib/test/support/__init__.py')
-rw-r--r--Lib/test/support/__init__.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/Lib/test/support/__init__.py b/Lib/test/support/__init__.py
index 42c41ff..f0e1507 100644
--- a/Lib/test/support/__init__.py
+++ b/Lib/test/support/__init__.py
@@ -2848,3 +2848,8 @@ class SaveSignals:
def restore(self):
for signum, handler in self.handlers.items():
self.signal.signal(signum, handler)
+
+
+def with_pymalloc():
+ import _testcapi
+ return _testcapi.WITH_PYMALLOC