Fix for http://mail.python.org/pipermail/python-dev/2006-April/063572.html Convert all PyMem_* to PyObject_* that way we can't have an inconsistent use of PyMem_ and PyObject_ APIs in the Parser. This could even be a perf win if more of the allocations are smaller than 256 bytes. I don't know if that's more common though.
Logged In: YES user_id=31435 I noted some cautions on python-dev, but marked Accepted. In general I'm nervous about more-or-less mindless s/x/y/g patches, but Guido's bug is proof that my time-consuming selective approach may well not be the best approach to this mess :-)
Logged In: YES user_id=33168 Heh, I'm going the opposite direction. I'm going to selectively move some of the known big calls back to PyMem_*. I also notice that there are a lot of allocs without this patch are larger than 256 bytes. I'm going to research those too. Thanks for the review.
Logged In: YES user_id=33168 The only inconsistency I could find was at line 818 of tokenizer.c: tok->buf = new; new is PyMem_*, but tok->buf is PyObject_* everywhere except this assignment. I didn't see an easy fix other than reallocating and copying instead of the assignment. I undid a few of the changes in the patch. Committed revision 45225.