diff options
author | Victor Stinner <vstinner@redhat.com> | 2019-05-17 15:20:52 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-05-17 15:20:52 +0200 |
commit | b16b4e45923f4e4dfd8e970ae4e6a934faf73b79 (patch) | |
tree | fb7b3abc251f148386efdad7a5cde5d13d157d38 /Python/pylifecycle.c | |
parent | 80ed353329ef01ca6ab2056051fb999818a86215 (diff) | |
download | cpython-b16b4e45923f4e4dfd8e970ae4e6a934faf73b79.tar.gz cpython-b16b4e45923f4e4dfd8e970ae4e6a934faf73b79.zip |
bpo-36763: Add PyMemAllocatorName (GH-13387)
* Add PyMemAllocatorName enum
* _PyPreConfig.allocator type becomes PyMemAllocatorName, instead of
char*
* Remove _PyPreConfig_Clear()
* Add _PyMem_GetAllocatorName()
* Rename _PyMem_GetAllocatorsName() to
_PyMem_GetCurrentAllocatorName()
* Remove _PyPreConfig_SetAllocator(): just call
_PyMem_SetupAllocators() directly, we don't have do reallocate the
configuration with the new allocator anymore!
* _PyPreConfig_Write() parameter becomes const, as it should be in
the first place!
Diffstat (limited to 'Python/pylifecycle.c')
-rw-r--r-- | Python/pylifecycle.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/Python/pylifecycle.c b/Python/pylifecycle.c index e89152637fe..eecb439a11d 100644 --- a/Python/pylifecycle.c +++ b/Python/pylifecycle.c @@ -706,26 +706,22 @@ _Py_PreInitializeFromPyArgv(const _PyPreConfig *src_config, const _PyArgv *args) if (src_config) { if (_PyPreConfig_Copy(&config, src_config) < 0) { err = _Py_INIT_NO_MEMORY(); - goto done; + return err; } } err = _PyPreConfig_Read(&config, args); if (_Py_INIT_FAILED(err)) { - goto done; + return err; } err = _PyPreConfig_Write(&config); if (_Py_INIT_FAILED(err)) { - goto done; + return err; } runtime->pre_initialized = 1; - err = _Py_INIT_OK(); - -done: - _PyPreConfig_Clear(&config); - return err; + return _Py_INIT_OK(); } |