Add the co_extra field and accompanying APIs to code objects.
This completes PEP 523.
diff --git a/Include/pystate.h b/Include/pystate.h
index 5a06773..5ab5c98 100644
--- a/Include/pystate.h
+++ b/Include/pystate.h
@@ -8,6 +8,10 @@
extern "C" {
#endif
+/* This limitation is for performance and simplicity. If needed it can be
+removed (with effort). */
+#define MAX_CO_EXTRA_USERS 255
+
/* State shared between threads */
struct _ts; /* Forward */
@@ -141,6 +145,9 @@
PyObject *coroutine_wrapper;
int in_coroutine_wrapper;
+ Py_ssize_t co_extra_user_count;
+ freefunc co_extra_freefuncs[MAX_CO_EXTRA_USERS];
+
/* XXX signal handlers should also be here */
} PyThreadState;