Message209663
Proposed patches replaced idiomatic code
Py_DECREF(ptr);
ptr = new_value;
to "Py_REPLACE(ptr, new_value);" which is expanded to
{
PyObject *__tmp__ = ptr;
ptr = new_value;
Py_DECREF(__tmp__);
}
(and same for Py_XDECREF -> Py_XREPLACE).
Victor proposed large patch for issue16447, but this issue was closed after fixing particular bug. Here are updated patches, which Py_REPLACE/Py_XREPLACE macros for cleaner code. They are also generated automatically by the Coccinelle tool (http://coccinelle.lip6.fr/):
spatch --in-place --sp-file py_replace.spatch --dir .
Patch for every version contains about 50 replaces in about 21-24 files. |
|
Date |
User |
Action |
Args |
2014-01-29 18:14:18 | serhiy.storchaka | set | recipients:
+ serhiy.storchaka, georg.brandl, vstinner, larry, benjamin.peterson, skrah |
2014-01-29 18:14:18 | serhiy.storchaka | set | messageid: <1391019258.76.0.341506038923.issue20440@psf.upfronthosting.co.za> |
2014-01-29 18:14:18 | serhiy.storchaka | link | issue20440 messages |
2014-01-29 18:14:18 | serhiy.storchaka | create | |
|