Message328620
I decided to work on this issue while trying to convert the _PyObject_GC_TRACK() macro into a "static inline" function. Currently, the macro uses _PyGC_generation0 which is defined earlier by "extern PyGC_Head *_PyGC_generation0;".
Problem: _PyGC_generation0 no longer exists... Include/internal/mem.h now defines: "#define _PyGC_generation0 _PyRuntime.gc.generation0".
Include/internal/mem.h includes Include/objimpl.h, but Include/objimpl.h requires Include/internal/mem.h. The include order matters here, many header files are inter-dependent, and have two header files with the same name in Include/ and Include/internal/ causes issues depending where the #include is done...
My PR renames mem.h to pycore_objimpl.h and include pycore_objimpl.h at "the right place" in objimpl.h. Since objimpl.h controls where pycore_objimpl.h is imported, it's simpler to handle inter-dependencies simpler.
Some inter-dependencies issues are hidden by the fact the C macros don't really require functions, macros and variables in the right order. They "just work". But converting C macros to proper "static inline" functions expose many issues. |
|
Date |
User |
Action |
Args |
2018-10-27 00:50:05 | vstinner | set | recipients:
+ vstinner |
2018-10-27 00:50:05 | vstinner | set | messageid: <1540601405.81.0.788709270274.issue35081@psf.upfronthosting.co.za> |
2018-10-27 00:50:05 | vstinner | link | issue35081 messages |
2018-10-27 00:50:05 | vstinner | create | |
|