16 Commits

Author SHA1 Message Date
Brian Anderson
19ad88c2b8 core: Mark gc and stackwalk as demoded 2012-09-20 17:29:20 -07:00
Brian Anderson
c115b82238 core: Clean up crate docs and give all mods a brief description 2012-09-19 16:52:59 -07:00
Brian Anderson
2906f2de31 core: Rename 'unsafe' mod to 'cast' 2012-09-18 19:36:25 -07:00
Brian Anderson
298eb8c726 Convert 'import' to 'use'. Remove 'import' keyword. 2012-09-10 19:04:26 -07:00
Brian Anderson
2810ea9a68 Convert 'again' to 'loop'. Remove 'again' keyword 2012-09-07 17:39:03 -07:00
Brian Anderson
2572e80355 Remove 'let' syntax for struct fields 2012-09-07 14:02:33 -07:00
Elliott Slaughter
cb53623341 gc: Add early abort when GC is disabled. 2012-09-07 09:21:22 -07:00
Elliott Slaughter
244b95490b gc: Refactoring. 2012-09-07 09:21:22 -07:00
Elliott Slaughter
d22b7ca39a gc: Documentation. 2012-09-07 09:21:22 -07:00
Elliott Slaughter
961bd48724 gc: Fix for GC missing stack frames across segment boundaries. 2012-09-07 09:21:22 -07:00
Elliott Slaughter
578b036f9b gc: Don't expect sentinel when core is compiled without GC. 2012-09-07 09:21:22 -07:00
Elliott Slaughter
7823ad8586 gc: Avoid walking stack above caller frame.
Mark the base GC stack frame with a sentinel value so we know when to
start collecting.
2012-09-07 09:21:21 -07:00
Elliott Slaughter
88f5ab3163 gc: Fix for deallocating resources on the shared heap while cleaning stack. 2012-09-07 09:21:21 -07:00
Elliott Slaughter
3405c548e8 gc: Avoid freeing null pointers. 2012-09-07 09:21:21 -07:00
Elliott Slaughter
9ea4afe5da gc: Avoid double free when pointer appears on stack multiple times. 2012-09-07 09:21:21 -07:00
Elliott Slaughter
3f0d207b32 gc: Add stack walker for new garbage collector.
Safe points are exported in a per-module list via the crate map. A C
runtime call walks the crate map at startup and aggregates the list of
safe points for the program.

Currently the GC doesn't actually deallocate memory on malloc and
free. Adding the GC at this stage is primarily of testing value.

The GC does attempt to clean up exchange heap and stack-allocated
resource on failure.

A result of this patch is that the user now needs to be careful about
what code they write in destructors, because the GC and/or failure
cleanup may need to call destructors. Specifically, calls to malloc
are considered unsafe and may result in infinite loops or segfaults.
2012-09-07 09:21:21 -07:00