mirror of
https://github.com/python/cpython.git
synced 2025-07-19 17:25:54 +00: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
|
@ -453,7 +453,8 @@ preconfig_read(_PyPreConfig *config, const _PyPreCmdline *cmdline)
|
|||
|
||||
/* allocator */
|
||||
if (config->dev_mode && config->allocator == NULL) {
|
||||
config->allocator = _PyMem_RawStrdup("debug");
|
||||
const char *allocator = _PyMem_GetDebugAllocatorsName();
|
||||
config->allocator = _PyMem_RawStrdup(allocator);
|
||||
if (config->allocator == NULL) {
|
||||
return _Py_INIT_NO_MEMORY();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue