Author ilblackdragon
Recipients Mark.Shannon, amaury.forgeotdarc, benjamin.peterson, brett.cannon, dmalcolm, ilblackdragon, jcea, larry, lemburg, mark.dickinson, vstinner
Date 2013-04-03.05:07:34
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1364965655.24.0.930543536884.issue17206@psf.upfronthosting.co.za>
In-reply-to
Content
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.
History
Date User Action Args
2013-04-03 05:07:35ilblackdragonsetrecipients: + ilblackdragon, lemburg, brett.cannon, jcea, amaury.forgeotdarc, mark.dickinson, vstinner, larry, benjamin.peterson, dmalcolm, Mark.Shannon
2013-04-03 05:07:35ilblackdragonsetmessageid: <1364965655.24.0.930543536884.issue17206@psf.upfronthosting.co.za>
2013-04-03 05:07:35ilblackdragonlinkissue17206 messages
2013-04-03 05:07:35ilblackdragoncreate