On 4/10/06, Tim Peters <tim.peters at gmail.com> wrote: > It's documented (after a fashion) at the declaration of > PyOS_ReadlineFunctionPointer. Yesterday that read: > > """ > /* By initializing this function pointer, systems embedding Python can > override the readline function. > > Note: Python expects in return a buffer allocated with PyMem_Malloc. */ > > char *(*PyOS_ReadlineFunctionPointer)(FILE *, FILE *, char *); > """ > > Overnight, "PyMem_Malloc" there changed to "PyObject_Malloc". It > didn't matter in practice before (2.5) because all PyXYZ_ABC ways to > spell "free the memory" resolved to PyObject_Free. Now that PyMem_ > and PyObject_ call different things, mismatches are deadly. Since > the only docs we had said PyMem_Malloc must be used for the readline > function, best to stick with that. It's messy, though (there are a > lot of functions that think they're in charge of freeing the memory, > and the memory can originally come from a lot of places). Shouldn't it at least match call_readline() in Modules/readline.c, which uses PyMem_Malloc()? Also, since it's really a char array, I don't see the point of using something with "Object" in its name. -- --Guido van Rossum (home page: http://www.python.org/~guido/)
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4