[issue17206] Py_XDECREF() expands its argument multiple times

2013-05-16 Thread Illia Polosukhin
Illia Polosukhin added the comment: Amaury, I didn't update Py_INCREF macro in this patch (because it doesn't expand it's argument multiple times) - so the examples you are showing will be working fine. I've updated Py_XINCREF, but it can't be use

[issue17206] Py_XDECREF() expands its argument multiple times

2013-04-02 Thread Illia Polosukhin
Illia Polosukhin added the comment: Fixed Py_DECREF and Py_CLEAR as well. Added tests for Py_INCREF and Py_XINCREF (if somebody has a better idea how to tests that INCREF doesn't leak - please, let me know). Removed comment that Py_DECREF evaluate it's argument multiple ti

[issue17206] Py_XDECREF() expands its argument multiple times

2013-03-30 Thread Illia Polosukhin
Illia Polosukhin added the comment: Updated patch - removed old code and addded tests to _testcapimoudule.c as Amaury suggested. Amaury, why do you mention -R flag (from what I see it does hash randomization)? I would expect some flag, that would enforce memory leakage issues to fail test

[issue17206] Py_XDECREF() expands its argument multiple times

2013-03-20 Thread Illia Polosukhin
Illia Polosukhin added the comment: Additionally, disassembled ceval.o and compared baseline with experiment (with applied patch): no actual differences found. Attached archive contains ceval from both baseline and experiment builds: - cevalb.cc - processed file of baseline build - ceval.cc

[issue17206] Py_XDECREF() expands its argument multiple times

2013-03-20 Thread Illia Polosukhin
Illia Polosukhin added the comment: Compiled baseline and patched version with GCC in Ubuntu 12.10 (running in VMWare). Benchmarking results are attached: ./perf.py -b 2n3 -f ../cpython/baseline/python ../cpython/experiment/python | tee perf-linux.log -- Added file: http

[issue2786] Names in traceback should have class names, if they're methods

2013-03-20 Thread Illia Polosukhin
Illia Polosukhin added the comment: The issue is not that easy to address - because PyFunctionObject is not available from PyEval_EvalCodeEx. Another note, is that the issue of reporting only function name without class name is observed in many places, not just for example above. Still, will

[issue17206] Py_XDECREF() expands its argument multiple times

2013-03-18 Thread Illia Polosukhin
Illia Polosukhin added the comment: That names were my first idea - but then I saw Py_CLEAR uses _py_tmp variable I used it. Should I replace in Py_CLEAR to _py_clear_tmp as well? -- ___ Python tracker <http://bugs.python.org/issue17

[issue2786] Names in traceback should have class names, if they're methods

2013-03-18 Thread Illia Polosukhin
Illia Polosukhin added the comment: Talked with David Murray (r.david.murray) at @pycon2013 sprints - will try to address this. -- nosy: +ilblackdragon ___ Python tracker <http://bugs.python.org/issue2

[issue17206] Py_XDECREF() expands its argument multiple times

2013-03-17 Thread Illia Polosukhin
Illia Polosukhin added the comment: Command used for benchmarking was: python perf.py -b 2n3 -f ../cpython/baseline-clang/python.exe ../cpython/experiment-clang/python.exe | tee perf.log -- ___ Python tracker <http://bugs.python.org/issue17

[issue17206] Py_XDECREF() expands its argument multiple times

2013-03-17 Thread Illia Polosukhin
Illia Polosukhin added the comment: Benchmark run on Clang Mac OS X 10.7 attached of comparison with and without patch 17206.diff. -- Added file: http://bugs.python.org/file29440/perf.log ___ Python tracker <http://bugs.python.org/issue17

[issue17206] Py_XDECREF() expands its argument multiple times

2013-03-17 Thread Illia Polosukhin
Illia Polosukhin added the comment: Additionally, in macros Py_XINCREF and Py_XDECREF we've took an opportunity to increase readability by changing expression: > if (item == NULL) ; else action(item); to more natural inverted condition: > if (item != NULL) action(item); There is a

[issue17206] Py_XDECREF() expands its argument multiple times

2013-03-17 Thread Illia Polosukhin
Illia Polosukhin added the comment: I've worked on this with Dave Malcolm @PyCon2013 sprints. This patch is work in progress to make Py_XDECREF() and Py_XINCREF() expands their arguments once instead of multiple times. Because patch is work in progress, it contains old version for ea