gc
gc copied to clipboard
A garbage collector for Crystal
When starting a collection, we must tell all crystal threads to stop and save their current fiber context to the stack.
C99 is nice but it's so damn old. Migrating to [C11](https://en.cppreference.com/w/c/11) would allow to use platform agnostic atomics and maybe threads (must verify compatibility with #20). See https://en.cppreference.com/w/c/thread for details....
Currently, the algorithms loads the roots at every collection, but that's unnecessary for all the fixed segments of the binary. It would be better to have them always loaded and...
Related #15 (for macOS) dlopen adds various data/text segments that we need to add as roots. #24 fixes it for macOS, but a similar idea should be taken in place...
Still WIP. For the moment it just compiles, but it fails at first collection. It's not loading the space addresses from the macho specification (that will come in a later...
Instead of mapping an absurd amount of memory, this patch attempts to only allocate the current size we need, and then call mremap to grow the memory. Despite retaining the...
`GC_map()` currently tells the kernel to allocate as much (virtual) memory as possible, but we could be smarter about it. Instead of asking for as much memory as there are...
The collector is significantly slower than BDWGC. There must be room for enhancement, for example: 1. unmark small and large objects in parallel; 2. scan/mark objects from multiple threads; 3....
The current solution to determine the DATA and BSS sections (initialized & uninitialized global variables) is invalid for Darwin dynamic linker (DYLD). We assume a memory layout that is a...
We only support the linux-gnu target, which is the computer I use everyday. There are a few places that require platform specific stuff that may need to be adapted: 1....