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 times as not 
relevant anymore.

About considerations from performance point of view - I've made toy example 
(only this defines and main function) to test how gcc optimizer behaves in 
different cases - from what I see, if expression is like this (which is 
majority of cases in the code):
 PyObject* obj = Foo();
 Py_XDECREF(obj)

assembly code that will be produced (with -O3) is the same before and after 
patch.

----------
Added file: http://bugs.python.org/file29660/17206-3.diff

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue17206>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to