]> granicus.if.org Git - python/commit
As discussed on python-dev, really fix the PyMem_*/PyObject_* memory API
authorNeal Norwitz <nnorwitz@gmail.com>
Tue, 11 Apr 2006 08:19:15 +0000 (08:19 +0000)
committerNeal Norwitz <nnorwitz@gmail.com>
Tue, 11 Apr 2006 08:19:15 +0000 (08:19 +0000)
commit08062d6665b6a0c30559eb8a064356ca86151caf
treebd3aefcf6dd68268466453621dfd6c6b74b090bb
parent01b810106c348db2e3242126adf655b686aa2a1c
As discussed on python-dev, really fix the PyMem_*/PyObject_* memory API
mismatches.  At least I hope this fixes them all.

This reverts part of my change from yesterday that converted everything
in Parser/*.c to use PyObject_* API.  The encoding doesn't really need
to use PyMem_*, however, it uses new_string() which must return PyMem_*
for handling the result of PyOS_Readline() which returns PyMem_* memory.

If there were 2 versions of new_string() one that returned PyMem_*
for tokens and one that return PyObject_* for encodings that could
also fix this problem.  I'm not sure which version would be clearer.
This seems to fix both Guido's and Phillip's problems, so it's good enough
for now.  After this change, it would be good to review Parser/*.c
for consistent use of the 2 memory APIs.
Parser/myreadline.c
Parser/pgenmain.c
Parser/tokenizer.c