diff options
author | Victor Stinner <vstinner@python.org> | 2021-04-29 08:47:47 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-04-29 08:47:47 (GMT) |
commit | 645ed62fb4c09b7e23887fcca0767b0f2d7d3fd6 (patch) | |
tree | fc32b850519953ecef975a516a455dda65a72d34 /Include | |
parent | b1f413e6cf63a1c5704fcb47f2095ef5db8970bb (diff) | |
download | cpython-645ed62fb4c09b7e23887fcca0767b0f2d7d3fd6.zip cpython-645ed62fb4c09b7e23887fcca0767b0f2d7d3fd6.tar.gz cpython-645ed62fb4c09b7e23887fcca0767b0f2d7d3fd6.tar.bz2 |
bpo-43774: Remove unused PYMALLOC_DEBUG macro (GH-25711)
Enhance also the documentation of debug hooks on memory allocators.
Diffstat (limited to 'Include')
-rw-r--r-- | Include/Python.h | 9 | ||||
-rw-r--r-- | Include/objimpl.h | 4 | ||||
-rw-r--r-- | Include/pymem.h | 4 |
3 files changed, 4 insertions, 13 deletions
diff --git a/Include/Python.h b/Include/Python.h index 1df2fd5..4d0335d 100644 --- a/Include/Python.h +++ b/Include/Python.h @@ -72,15 +72,6 @@ # endif #endif -/* Debug-mode build with pymalloc implies PYMALLOC_DEBUG. - * PYMALLOC_DEBUG is in error if pymalloc is not in use. - */ -#if defined(Py_DEBUG) && defined(WITH_PYMALLOC) && !defined(PYMALLOC_DEBUG) -#define PYMALLOC_DEBUG -#endif -#if defined(PYMALLOC_DEBUG) && !defined(WITH_PYMALLOC) -#error "PYMALLOC_DEBUG requires WITH_PYMALLOC" -#endif #include "pymath.h" #include "pymem.h" diff --git a/Include/objimpl.h b/Include/objimpl.h index 689c42b..450befa 100644 --- a/Include/objimpl.h +++ b/Include/objimpl.h @@ -48,8 +48,8 @@ Functions and macros for modules that implement new object types. Note that objects created with PyObject_{New, NewVar} are allocated using the specialized Python allocator (implemented in obmalloc.c), if WITH_PYMALLOC is -enabled. In addition, a special debugging allocator is used if PYMALLOC_DEBUG -is also #defined. +enabled. In addition, a special debugging allocator is used if Py_DEBUG +macro is also defined. In case a specific form of memory management is needed (for example, if you must use the platform malloc heap(s), or shared memory, or C++ local storage or diff --git a/Include/pymem.h b/Include/pymem.h index 2f770b1..66cdb0d 100644 --- a/Include/pymem.h +++ b/Include/pymem.h @@ -25,8 +25,8 @@ extern "C" { heap used by the Python DLL; it could be a disaster if you free()'ed that directly in your own extension. Using PyMem_Free instead ensures Python can return the memory to the proper heap. As another example, in - PYMALLOC_DEBUG mode, Python wraps all calls to all PyMem_ and PyObject_ - memory functions in special debugging wrappers that add additional + a debug build (Py_DEBUG macro), Python wraps all calls to all PyMem_ and + PyObject_ memory functions in special debugging wrappers that add additional debugging info to dynamic memory blocks. The system routines have no idea what to do with that stuff, and the Python wrappers have no idea what to do with raw blocks obtained directly by the system routines then. |