mirror of
https://github.com/python/cpython.git
synced 2026-05-10 14:41:01 -04:00
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!
This commit is contained in:
+4
-8
@@ -2021,26 +2021,22 @@ core_read_precmdline(_PyCoreConfig *config, _PyPreCmdline *precmdline)
|
||||
_PyPreConfig preconfig = _PyPreConfig_INIT;
|
||||
if (_PyPreConfig_Copy(&preconfig, &_PyRuntime.preconfig) < 0) {
|
||||
err = _Py_INIT_NO_MEMORY();
|
||||
goto done;
|
||||
return err;
|
||||
}
|
||||
|
||||
_PyCoreConfig_GetCoreConfig(&preconfig, config);
|
||||
|
||||
err = _PyPreCmdline_Read(precmdline, &preconfig);
|
||||
if (_Py_INIT_FAILED(err)) {
|
||||
goto done;
|
||||
return err;
|
||||
}
|
||||
|
||||
if (_PyPreCmdline_SetCoreConfig(precmdline, config) < 0) {
|
||||
err = _Py_INIT_NO_MEMORY();
|
||||
goto done;
|
||||
return err;
|
||||
}
|
||||
|
||||
err = _Py_INIT_OK();
|
||||
|
||||
done:
|
||||
_PyPreConfig_Clear(&preconfig);
|
||||
return err;
|
||||
return _Py_INIT_OK();
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user