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:
Victor Stinner 2019-05-17 15:20:52 +02:00 committed by GitHub
parent 80ed353329
commit b16b4e4592
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 119 additions and 112 deletions

View file

@ -106,8 +106,6 @@ _PyRuntimeState_Fini(_PyRuntimeState *runtime)
runtime->xidregistry.mutex = NULL;
}
_PyPreConfig_Clear(&runtime->preconfig);
PyMem_SetAllocator(PYMEM_DOMAIN_RAW, &old_alloc);
}