summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorda-woods <dw-git@d-woods.co.uk>2021-09-20 08:34:34 +0100
committerGitHub <noreply@github.com>2021-09-20 09:34:34 +0200
commite2a23fe11063ee13c886e89007207a07a397e016 (patch)
tree4e9f6d7b0fae8dfb993b5b65cd377d77e1c9e4b1
parentaea4e6b84b38223c540266f8c57093ee2039f284 (diff)
downloadcython-e2a23fe11063ee13c886e89007207a07a397e016.tar.gz
Remove usused "FetchCommonPointer" utility code (GH-4380)
-rw-r--r--Cython/Utility/CommonStructures.c33
-rw-r--r--Cython/Utility/ModuleSetupCode.c2
2 files changed, 0 insertions, 35 deletions
diff --git a/Cython/Utility/CommonStructures.c b/Cython/Utility/CommonStructures.c
index 80055a330..c596e15bb 100644
--- a/Cython/Utility/CommonStructures.c
+++ b/Cython/Utility/CommonStructures.c
@@ -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;
-}
diff --git a/Cython/Utility/ModuleSetupCode.c b/Cython/Utility/ModuleSetupCode.c
index dcd081742..ee33ec194 100644
--- a/Cython/Utility/ModuleSetupCode.c
+++ b/Cython/Utility/ModuleSetupCode.c
@@ -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