Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Get the GC to work again and change the allocator
Allocator subsystem works with a single contiguous chunk of memory. Small object allocator uses fixed-size bins and never attempts to merge chunks, and the large object allocator is a slightly-modified version of the SQLite mem3.c allocator. The GC uses the boundaries of this chunk of memory, plus a table of flags, to determine if a Value refers to a heap allocation or not (we no longer have type information per-Value). The current implementation requires storing the size of each heap object in the GC header, but it should be possible to elide this requirement using flags (using 2 bits for each flag instead of 1, see golang GC implementation). Should support expanding the heap via. sbrk or similar (will require changing paw_Alloc to expand/contract the dynamic memory area, rather than implement a realloc-like interface).
- Loading branch information