mirror of
https://github.com/python/cpython
synced 2026-09-29 12:10:30 +03:00
bpo-36142: Add _PyMem_GetDebugAllocatorsName() (GH-12185)
The development mode now uses the effective name of the debug memory
allocator ("pymalloc_debug" or "malloc_debug"). So the name doesn't
change after setting the memory allocator.
This commit is contained in:
parent
d8b3a98c90
commit
a9df651eb4
5 changed files with 27 additions and 3 deletions
|
|
@ -221,6 +221,20 @@ static PyMemAllocatorEx _PyObject = PYOBJ_ALLOC;
|
|||
#endif
|
||||
|
||||
|
||||
/* Get the effective name of "debug" memory allocators,
|
||||
as if _PyMem_GetAllocatorsName() is called after
|
||||
_PyMem_SetupAllocators("debug"). */
|
||||
const char*
|
||||
_PyMem_GetDebugAllocatorsName(void)
|
||||
{
|
||||
#ifdef WITH_PYMALLOC
|
||||
return "pymalloc_debug";
|
||||
#else
|
||||
return "malloc_debug";
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
static int
|
||||
pymem_set_default_allocator(PyMemAllocatorDomain domain, int debug,
|
||||
PyMemAllocatorEx *old_alloc)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue