diff options
author | da-woods <dw-git@d-woods.co.uk> | 2022-12-01 19:40:43 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-12-01 19:40:43 +0000 |
commit | 9f36dda6bcf70663bd4c960c322d776097ee4215 (patch) | |
tree | ee5f65ff5944525575ccc54de87ca5ac4a6b656f /Cython/Utility/StringTools.c | |
parent | ed0c0237b7151d387c5de08a816bce34fc16fcf2 (diff) | |
download | cython-9f36dda6bcf70663bd4c960c322d776097ee4215.tar.gz |
Refactor module state to always use struct (#5056)
First part of https://github.com/cython/cython/issues/3689
First part of https://github.com/cython/cython/issues/4495
This tries to put all the global static variables into the
module state struct. When CYTHON_USE_MODULE_STATE is false,
they're looked up from a single static instance of the struct.
This allows a lot of semi-duplicated code to be dropped.
It doesn't get rid of the awkward `#defines` to access the
struct (that's probably the next step of the cleanup).
It moves the stringtab from a global into a function local.
It moves the statically defined coroutine types into the
module state struct in the same way that CyFunction/FusedFunction
already were.
It's mostly an exercise in deleting things - it doesn't
attempt to do any significant cleanup of the generation code.
Diffstat (limited to 'Cython/Utility/StringTools.c')
-rw-r--r-- | Cython/Utility/StringTools.c | 6 |
1 files changed, 0 insertions, 6 deletions
diff --git a/Cython/Utility/StringTools.c b/Cython/Utility/StringTools.c index 910fbf6fa..6b192a1d9 100644 --- a/Cython/Utility/StringTools.c +++ b/Cython/Utility/StringTools.c @@ -43,11 +43,7 @@ static CYTHON_INLINE Py_ssize_t __Pyx_Py_UNICODE_ssize_strlen(const Py_UNICODE * //////////////////// InitStrings.proto //////////////////// -#if CYTHON_COMPILING_IN_LIMITED_API -static int __Pyx_InitString(__Pyx_StringTabEntry t, PyObject **str); /*proto*/ -#else static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /*proto*/ -#endif //////////////////// InitStrings //////////////////// @@ -73,7 +69,6 @@ static int __Pyx_InitString(__Pyx_StringTabEntry t, PyObject **str) { } #endif -#if !CYTHON_COMPILING_IN_LIMITED_API static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { while (t->p) { #if PY_MAJOR_VERSION >= 3 /* Python 3+ has unicode identifiers */ @@ -96,7 +91,6 @@ static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { } return 0; } -#endif //////////////////// BytesContains.proto //////////////////// |