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.
Showing
src/libcore/gc.rs
0 → 100644
src/rt/rust_crate_map.cpp
0 → 100644
src/rt/rust_crate_map.h
0 → 100644
src/rt/rust_gc_metadata.cpp
0 → 100644
src/rt/rust_gc_metadata.h
0 → 100644
想要评论请 注册 或 登录