PTAL. This assumes that all PyMethodDefs are global and live forever, which is certainly the ...
16 years, 6 months ago
(2009-12-16 23:11:05 UTC)
#1
PTAL. This assumes that all PyMethodDefs are global and live forever, which is
certainly the case in CPython, and should be for all extension modules. I can
imagine someone allocating a PyMethodDef and taking a weakref to the PyCFunction
(does it even support that?) and then deallocating the methoddef when it's
freed, but that's insane.
http://codereview.appspot.com/179086/diff/8/10 File Util/RuntimeFeedback.cc (left): http://codereview.appspot.com/179086/diff/8/10#oldcode59 Util/RuntimeFeedback.cc:59: else if (src.InFuncMode() && src.data_[i].getPointer() != NULL) { On ...
16 years, 6 months ago
(2009-12-17 01:20:48 UTC)
#3
http://codereview.appspot.com/179086/diff/8/10
File Util/RuntimeFeedback.cc (left):
http://codereview.appspot.com/179086/diff/8/10#oldcode59
Util/RuntimeFeedback.cc:59: else if (src.InFuncMode() &&
src.data_[i].getPointer() != NULL) {
On 2009/12/17 00:23:43, Collin Winter wrote:
> You can't Py_INCREF a PyMethodDef. FuncMode needs to stick around.
I didn't remove func mode, so don't worry, it doesn't try to incref the
PyMethodDef. It just copies the data as normal.
Issue 179086: Remove FunctionRecord objects in favor of existing PyMethodDef globals
(Closed)
Created 16 years, 6 months ago by Reid Kleckner
Modified 16 years, 6 months ago
Reviewers: Collin Winter, collinwinter
Base URL:
Comments: 2