cpython/Doc/c-api
Victor Stinner 2fe9bac4dc Close #16742: Fix misuse of memory allocations in PyOS_Readline()
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.
2013-10-10 16:18:20 +02:00
..
abstract.rst Merged revisions 85082 via svnmerge from 2010-09-28 23:41:31 +00:00
allocation.rst Issue #18589: fix hyperlinking of type slots (tp_*) 2013-08-01 21:12:45 +02:00
apiabiversion.rst Remove row-spanning cell, which the Sphinx text writer does not support. 2013-03-16 08:01:49 +01:00
arg.rst #16518: use "bytes-like object" throughout the docs. 2013-05-04 18:06:34 +03:00
bool.rst Migrate to Sphinx 1.0 C language constructs. 2010-10-06 10:11:56 +00:00
buffer.rst Closes #4159: add LaTeX tabular column specifications to tables that otherwise are cut off or have overlapping text. 2013-03-28 13:28:44 +01:00
bytearray.rst #16518: use "bytes-like object" throughout the docs. 2013-05-04 18:06:34 +03:00
bytes.rst Closes #4159: add LaTeX tabular column specifications to tables that otherwise are cut off or have overlapping text. 2013-03-28 13:28:44 +01:00
capsule.rst Migrate to Sphinx 1.0 C language constructs. 2010-10-06 10:11:56 +00:00
cell.rst Migrate to Sphinx 1.0 C language constructs. 2010-10-06 10:11:56 +00:00
code.rst Issue #14090: fix some minor C API problems in default branch (3.3) 2012-06-03 08:07:47 +03:00
codec.rst Issue 19195: Improved cross-references in C API documentation. 2013-10-09 13:26:17 +03:00
complex.rst Issue #13522: Fix _Py_co_pow() documentation 2011-12-18 02:56:18 +01:00
concrete.rst Migrate to Sphinx 1.0 C language constructs. 2010-10-06 10:11:56 +00:00
conversion.rst Issue #14090: fix some minor C API problems in default branch (3.3) 2012-06-03 08:07:47 +03:00
datetime.rst Issue #13727: Add 3 macros to access PyDateTime_Delta members: 2012-01-17 21:31:50 +01:00
descriptor.rst Migrate to Sphinx 1.0 C language constructs. 2010-10-06 10:11:56 +00:00
dict.rst fix spelling (#17327) 2013-03-11 12:17:19 -05:00
exceptions.rst Close #11619: The parser and the import machinery do not encode Unicode 2013-08-26 22:28:21 +02:00
file.rst Issue 19195: Improved cross-references in C API documentation. 2013-10-09 13:26:17 +03:00
float.rst Issue #13522: document error return values of some float and complex C API functions. 2011-12-18 01:25:27 +01:00
function.rst PEP 3155 / issue #13448: Qualified name for classes and functions. 2011-11-25 18:56:07 +01:00
gcsupport.rst Issue #18589: fix hyperlinking of type slots (tp_*) 2013-08-01 21:12:45 +02:00
gen.rst Migrate to Sphinx 1.0 C language constructs. 2010-10-06 10:11:56 +00:00
import.rst Fix rst markup. 2012-09-20 08:33:53 +03:00
index.rst Close #15465: Document C API version macros 2013-03-07 23:14:44 +10:00
init.rst Add a "skull and crossbones" to Py_AddPendingCall. 2013-09-30 21:38:49 +02:00
intro.rst Clean up references to the no longer existing PyString_ APIs in our docs. 2013-03-22 13:43:30 -07:00
iter.rst Issue #19005: Fix documentation for PyIter_Next(). 2013-10-09 22:42:46 -07:00
iterator.rst Migrate to Sphinx 1.0 C language constructs. 2010-10-06 10:11:56 +00:00
list.rst Issue #13389: Full garbage collection passes now clear the freelists for 2011-11-15 00:00:12 +01:00
long.rst Merge with 3.2: Issue #17047: removed doubled words in Doc/*, 2013-03-11 17:26:33 -04:00
mapping.rst Migrate to Sphinx 1.0 C language constructs. 2010-10-06 10:11:56 +00:00
marshal.rst Migrate to Sphinx 1.0 C language constructs. 2010-10-06 10:11:56 +00:00
memory.rst Issue #18874: _PyObject_Malloc/Realloc/Free() now falls back on 2013-10-10 15:58:42 +02:00
memoryview.rst Add PyMemoryView_FromMemory() to whatsnew/3.3. 2012-02-29 17:27:21 +01:00
method.rst Remove duplication. 2011-10-19 10:58:56 +03:00
module.rst Issue #18668: Further clarify m_size setting for non-negative values 2013-08-10 05:58:10 -07:00
none.rst Migrate to Sphinx 1.0 C language constructs. 2010-10-06 10:11:56 +00:00
number.rst Issue #13145. Fix incorrect documentation for PyNumber_ToBase. Thanks Sven Marnach. 2011-10-11 18:06:36 +01:00
objbuffer.rst Migrate to Sphinx 1.0 C language constructs. 2010-10-06 10:11:56 +00:00
object.rst Issue 19195: Improved cross-references in C API documentation. 2013-10-09 13:26:57 +03:00
objimpl.rst Split C API docs in Py3k branch. 2008-01-20 09:30:57 +00:00
refcounting.rst Migrate to Sphinx 1.0 C language constructs. 2010-10-06 10:11:56 +00:00
reflection.rst Migrate to Sphinx 1.0 C language constructs. 2010-10-06 10:11:56 +00:00
sequence.rst let PySequence_Check me a link; thanks to tomo cocoa from docs@ 2011-08-13 00:39:46 +02:00
set.rst Issue 19195: Improved cross-references in C API documentation. 2013-10-09 13:26:17 +03:00
slice.rst Merged revisions 87101,87146,87156,87172,87175,87371,87378,87522-87524,87526-87528,87530-87536,87581 via svnmerge from 2011-02-25 10:03:34 +00:00
stable.rst Close #15465: Document C API version macros 2013-03-07 23:14:44 +10:00
structures.rst Migrate to Sphinx 1.0 C language constructs. 2010-10-06 10:11:56 +00:00
sys.rst Remove already dropped function PySys_GetFile from documentation. 2012-10-31 12:02:56 +02:00
tuple.rst Merged revisions 85572-85573,85606,85609-85622,85624,85626-85627,85629,85631,85633,85635-85636,85638-85639,85641-85642 via svnmerge from 2010-11-26 08:49:15 +00:00
type.rst Issue #18589: fix hyperlinking of type slots (tp_*) 2013-08-01 21:12:45 +02:00
typeobj.rst Issue 19195: Improved cross-references in C API documentation. 2013-10-09 13:26:57 +03:00
unicode.rst Issue 19195: Improved cross-references in C API documentation. 2013-10-09 13:26:57 +03:00
utilities.rst Merged revisions 86134,86315-86316,86390,86424-86425,86428,86550,86561-86562,86564-86565,86705,86708,86713 via svnmerge from 2010-11-26 09:05:43 +00:00
veryhigh.rst Close #16742: Fix misuse of memory allocations in PyOS_Readline() 2013-10-10 16:18:20 +02:00
weakref.rst demote this to a note 2011-05-31 21:27:41 -05:00