diff options
author | Victor Stinner <vstinner@redhat.com> | 2019-03-05 17:37:44 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-03-05 17:37:44 +0100 |
commit | b35be4b3334fbc471a39abbeb68110867b72e3e5 (patch) | |
tree | 4c311249db97ae7ebc5d2cb9ed48791549512afe /Python/pylifecycle.c | |
parent | 359a2f3daba49fde0d3a07fb3c7a8b051c450d08 (diff) | |
download | cpython-git-b35be4b3334fbc471a39abbeb68110867b72e3e5.tar.gz |
bpo-36142: Add _PyPreConfig.allocator (GH-12181)
* Move 'allocator' and 'dev_mode' fields from _PyCoreConfig
to _PyPreConfig.
* Fix InitConfigTests of test_embed: dev_mode sets allocator to
"debug", add a new tests for env vars with dev mode enabled.
Diffstat (limited to 'Python/pylifecycle.c')
-rw-r--r-- | Python/pylifecycle.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/Python/pylifecycle.c b/Python/pylifecycle.c index dec890485b..c955a1d94f 100644 --- a/Python/pylifecycle.c +++ b/Python/pylifecycle.c @@ -482,9 +482,9 @@ _Py_Initialize_ReconfigureCore(PyInterpreterState **interp_p, /* bpo-34008: For backward compatibility reasons, calling Py_Main() after Py_Initialize() ignores the new configuration. */ - if (core_config->allocator != NULL) { + if (core_config->preconfig.allocator != NULL) { const char *allocator = _PyMem_GetAllocatorsName(); - if (allocator == NULL || strcmp(core_config->allocator, allocator) != 0) { + if (allocator == NULL || strcmp(core_config->preconfig.allocator, allocator) != 0) { return _Py_INIT_USER_ERR("cannot modify memory allocator " "after first Py_Initialize()"); } @@ -521,8 +521,8 @@ pycore_init_runtime(const _PyCoreConfig *core_config) return err; } - if (core_config->allocator != NULL) { - if (_PyMem_SetupAllocators(core_config->allocator) < 0) { + if (core_config->preconfig.allocator != NULL) { + if (_PyMem_SetupAllocators(core_config->preconfig.allocator) < 0) { return _Py_INIT_USER_ERR("Unknown PYTHONMALLOC allocator"); } } |