mirror of https://github.com/python/cpython
2fe9bac4dc
The GIL must be held to call PyMem_Malloc(), whereas PyOS_Readline() releases the GIL to read input. The result of the C callback PyOS_ReadlineFunctionPointer must now be a string allocated by PyMem_RawMalloc() or PyMem_RawRealloc() (or NULL if an error occurred), instead of a string allocated by PyMem_Malloc() or PyMem_Realloc(). Fixing this issue was required to setup a hook on PyMem_Malloc(), for example using the tracemalloc module. PyOS_Readline() copies the result of PyOS_ReadlineFunctionPointer() into a new buffer allocated by PyMem_Malloc(). So the public API of PyOS_Readline() does not change. |
||
---|---|---|
.. | ||
2.0.rst | ||
2.1.rst | ||
2.2.rst | ||
2.3.rst | ||
2.4.rst | ||
2.5.rst | ||
2.6.rst | ||
2.7.rst | ||
3.0.rst | ||
3.1.rst | ||
3.2.rst | ||
3.3.rst | ||
3.4.rst | ||
changelog.rst | ||
index.rst |