mirror of
https://github.com/python/cpython.git
synced 2025-12-23 09:19:18 +00:00
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. |
||
|---|---|---|
| .. | ||
| acceler.c | ||
| asdl.py | ||
| asdl_c.py | ||
| bitset.c | ||
| firstsets.c | ||
| grammar.c | ||
| grammar1.c | ||
| listnode.c | ||
| metagrammar.c | ||
| myreadline.c | ||
| node.c | ||
| parser.c | ||
| parser.h | ||
| parsetok.c | ||
| parsetok_pgen.c | ||
| pgen.c | ||
| pgenmain.c | ||
| printgrammar.c | ||
| Python.asdl | ||
| spark.py | ||
| tokenizer.c | ||
| tokenizer.h | ||
| tokenizer_pgen.c | ||