SIP wrapper for CtVideo::Image::buffer does not use python API correct.
Macros Py_BEGIN_ALLOW_THREADS/Py_END_ALLOW_THREADS - releases/acquires python GIL. Releasing the GIL from extension code
According to the source code PyBytes_FromStringAndSize calls _PyBytes_FromSize line 134
_PyBytes_FromSize calls PyObject_Malloc. line 102
Documentation states that the GIL must be held when using these functions. Object allocators.
Code below show that PyBytes_FromStringAndSize is called with release GIL.
` SIP_PYOBJECT buffer() const;
%MethodCode
Py_BEGIN_ALLOW_THREADS
const char* buffer = sipCpp->buffer();
SIP_SSIZE_T size = sipCpp->size();
if (buffer)
sipRes = PyBytes_FromStringAndSize(buffer, size);
else
sipRes = Py_None;
Py_END_ALLOW_THREADS
%End`
SIP wrapper for CtVideo::Image::buffer does not use python API correct.
Macros Py_BEGIN_ALLOW_THREADS/Py_END_ALLOW_THREADS - releases/acquires python GIL. Releasing the GIL from extension code
According to the source code PyBytes_FromStringAndSize calls _PyBytes_FromSize line 134
_PyBytes_FromSize calls PyObject_Malloc. line 102
Documentation states that the GIL must be held when using these functions. Object allocators.
Code below show that PyBytes_FromStringAndSize is called with release GIL.
` SIP_PYOBJECT buffer() const;
%MethodCode
Py_BEGIN_ALLOW_THREADS
const char* buffer = sipCpp->buffer();
SIP_SSIZE_T size = sipCpp->size();
if (buffer)
sipRes = PyBytes_FromStringAndSize(buffer, size);
else
sipRes = Py_None;
Py_END_ALLOW_THREADS
%End`