diff options
author | Victor Stinner <vstinner@redhat.com> | 2019-03-05 22:31:54 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-03-05 22:31:54 (GMT) |
commit | a9df651eb4c18a07ec309df190419613e95cba7b (patch) | |
tree | 8c014426433938a9c94e7555b20eb13d78369cfa /Python/preconfig.c | |
parent | d8b3a98c9098c66a714fd5593e1928af0ffbc631 (diff) | |
download | cpython-a9df651eb4c18a07ec309df190419613e95cba7b.zip cpython-a9df651eb4c18a07ec309df190419613e95cba7b.tar.gz cpython-a9df651eb4c18a07ec309df190419613e95cba7b.tar.bz2 |
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.
Diffstat (limited to 'Python/preconfig.c')
-rw-r--r-- | Python/preconfig.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/Python/preconfig.c b/Python/preconfig.c index 98e0ede..46e1809 100644 --- a/Python/preconfig.c +++ b/Python/preconfig.c @@ -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(); } |