Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
integrate with GCC's garbage collector (ticket #1)
Support creating instances of PyTypeObject subclasses in cpybuilder.py, and convert all of the various wrapper object classes from being PyObject subclasses to being subclassed from PyGccWrapper. All instances of PyGccWrapper are now tracked in a doubly-linked list (and thus the types require a tp_dealloc of gcc_python_wrapper_dealloc in order to remove them from this list. Introduce wrapperbuilder.py and use it to convert all of the type objects for the wrapper classes to being instances of a new PyGccWrapperTypeObject. The above class changes allow us to add a new per-wrapper hook ("wrtp_mark") for working with GCC's garbage collector. Change "struct_name" from "struct foo" to "foo" when creating PyTypeObject instances in the various generate-*-c.py files, so that we can easily match up the autogenerated "wrtp_mark_for" callback from that file with the declaration of said callback from the DECLARE_SIMPLE_WRAPPER() macro in gcc-python.h Wire up to GCC's garbage collector (in the new gcc-python-wrapper.c), so that when it runs, we can iterate through all of our wrapper objects, and mark the wrapped objects, so they don't get swept (and deleted) from under us. Add gcc._gc_selftest() to exercise this machinery (for trees only, so far, and without exercising recursive marking) Add gc._force_garbage_collection() and a selftest for this. Fixes https://fedorahosted.org/gcc-python-plugin/ticket/1
- Loading branch information
1 parent
e75f80d
commit 58d65a1
Showing
37 changed files
with
887 additions
and
163 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.