Hi
I would like to be able to get an handle on PyGC_Head*_PyGC_generation0 from a
CPython extension.
This is possible when building Python on a Posix host, but not on Windows
because of a missing PyAPI_DATA wrapping of the said object in the objimpl.h
header.
Having the possibility to inspect the PyGC_Head here can be very useful when
customizing the way a garbage-collectable object created from CPython extension
would be cleaned/inspected, etc.
Any chance this patch could be added to get the same capabilities on Windows
and Posix platforms ?
Thanks for your feedback,
Eloi
Index: Include/objimpl.h
===================================================================
--- Include/objimpl.h (revision 118072)
+++ Include/objimpl.h (working copy)
@@ -258,7 +258,7 @@
double dummy; /* force worst-case alignment */
} PyGC_Head;
-extern PyGC_Head *_PyGC_generation0;
+PyAPI_DATA(PyGC_Head*) _PyGC_generation0;
#define _Py_AS_GC(o) ((PyGC_Head *)(o)-1)
_______________________________________________
Python-ideas mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at
https://mail.python.org/archives/list/[email protected]/message/7FC2NHAOMKBHONFTUKMAHO5F56UU5UUD/
Code of Conduct: http://python.org/psf/codeofconduct/