Commit e2a23fe1 authored by da-woods's avatar da-woods Committed by GitHub

Remove usused "FetchCommonPointer" utility code (GH-4380)

parent aea4e6b8
......@@ -125,36 +125,3 @@ bad:
}
#endif
/////////////// FetchCommonPointer.proto ///////////////
static void* __Pyx_FetchCommonPointer(void* pointer, const char* name);
/////////////// FetchCommonPointer ///////////////
static void* __Pyx_FetchCommonPointer(void* pointer, const char* name) {
PyObject* abi_module = NULL;
PyObject* capsule = NULL;
void* value = NULL;
abi_module = PyImport_AddModule((char*) __PYX_ABI_MODULE_NAME);
if (!abi_module) return NULL;
Py_INCREF(abi_module);
capsule = PyObject_GetAttrString(abi_module, name);
if (!capsule) {
if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad;
PyErr_Clear();
capsule = PyCapsule_New(pointer, name, NULL);
if (!capsule) goto bad;
if (PyObject_SetAttrString(abi_module, name, capsule) < 0)
goto bad;
}
value = PyCapsule_GetPointer(capsule, name);
bad:
Py_XDECREF(capsule);
Py_DECREF(abi_module);
return value;
}
......@@ -1678,7 +1678,6 @@ static void __Pyx_FastGilFuncInit(void);
#endif
/////////////// FastGil ///////////////
//@requires: CommonStructures.c::FetchCommonPointer
// The implementations of PyGILState_Ensure/Release calls PyThread_get_key_value
// several times which is turns out to be quite slow (slower in fact than
// acquiring the GIL itself). Simply storing it in a thread local for the
......@@ -1780,7 +1779,6 @@ static void __Pyx_FastGilFuncInit0(void) {
#else
static void __Pyx_FastGilFuncInit0(void) {
CYTHON_UNUSED_VAR(&__Pyx_FetchCommonPointer);
}
#endif
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment