Skip to content

bpo-32030: Add _PyImport_Fini2()#4737

Merged
vstinner merged 1 commit intopython:masterfrom
vstinner:pyimport_fini2
Dec 6, 2017
Merged

bpo-32030: Add _PyImport_Fini2()#4737
vstinner merged 1 commit intopython:masterfrom
vstinner:pyimport_fini2

Conversation

@vstinner
Copy link
Member

@vstinner vstinner commented Dec 6, 2017

PyImport_ExtendInittab() now uses PyMem_RawRealloc() rather than
PyMem_Realloc(). PyImport_ExtendInittab() can be called before
Py_Initialize() whereas only the PyMem_Raw allocator is supposed to
be used before Py_Initialize().

Add _PyImport_Fini2() to release the memory allocated by
PyImport_ExtendInittab() at exit. PyImport_ExtendInittab() now forces
the usage of the default raw allocator, to be able to release memory
in _PyImport_Fini2().

Don't export these functions anymore to be C API, only to
Py_BUILD_CORE:

  • _PyExc_Fini()
  • _PyImport_Fini()
  • _PyGC_DumpShutdownStats()
  • _PyGC_Fini()
  • _PyType_Fini()
  • _Py_HashRandomization_Fini()

https://bugs.python.org/issue32030

PyImport_ExtendInittab() now uses PyMem_RawRealloc() rather than
PyMem_Realloc(). PyImport_ExtendInittab() can be called before
Py_Initialize() whereas only the PyMem_Raw allocator is supposed to
be used before Py_Initialize().

Add _PyImport_Fini2() to release the memory allocated by
PyImport_ExtendInittab() at exit. PyImport_ExtendInittab() now forces
the usage of the default raw allocator, to be able to release memory
in _PyImport_Fini2().

Don't export these functions anymore to be C API, only to
Py_BUILD_CORE:

* _PyExc_Fini()
* _PyImport_Fini()
* _PyGC_DumpShutdownStats()
* _PyGC_Fini()
* _PyType_Fini()
* _Py_HashRandomization_Fini()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants