[Python-Dev] pdb segfaults in 2.5 trunk? (original) (raw)
Guido van Rossum guido at python.org
Tue Apr 11 00:06:52 CEST 2006
- Previous message: [Python-Dev] pdb segfaults in 2.5 trunk?
- Next message: [Python-Dev] pdb segfaults in 2.5 trunk?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On 4/10/06, Tim Peters <tim.peters at gmail.com> wrote:
It's documented (after a fashion) at the declaration of PyOSReadlineFunctionPointer. 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 PyMemMalloc. */ char *(*PyOSReadlineFunctionPointer)(FILE *, FILE *, char *); """ Overnight, "PyMemMalloc" there changed to "PyObjectMalloc". It didn't matter in practice before (2.5) because all PyXYZABC ways to spell "free the memory" resolved to PyObjectFree. Now that PyMem and PyObject call different things, mismatches are deadly. Since the only docs we had said PyMemMalloc 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/)
- Previous message: [Python-Dev] pdb segfaults in 2.5 trunk?
- Next message: [Python-Dev] pdb segfaults in 2.5 trunk?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]