Message285713
I think basic idea is "wrap unknown function call at least once, and preferably only once".
_PyEval_EvalFrameDefault() calls Py_EnterRecursiveCall("").
So wrapping PyFunction_(Fast)Call* with Py_EnterRecursiveCall() seems redundant.
On the other hand, PyCFunction may calls method of extension module,
and it can cause recursive call.
So I think PyCFunction_*Call* methods calling function pointer it has
(e.g. _PyCFunction_FastCallKeywords) should call Py_EnterRecursiveCall().
And caller of them can skip Py_EnterRecursiveCall().
For example, _PyObject_FastCallDict() may call _PyFunction_FastCallDict() or
_PyCFunction_FastCallDict(), or tp_fastcall (via _Py_RawFastCallDict) or tp_call.
It can wrap all, but wrapping only tp_fastcall and tp_call is better. |
|
Date |
User |
Action |
Args |
2017-01-18 10:10:41 | methane | set | recipients:
+ methane, vstinner |
2017-01-18 10:10:41 | methane | set | messageid: <1484734241.81.0.416772281293.issue29306@psf.upfronthosting.co.za> |
2017-01-18 10:10:41 | methane | link | issue29306 messages |
2017-01-18 10:10:41 | methane | create | |
|