#ifndef _HEAP_H_ #define _HEAP_H_ #include #include #include "value.h" #include "value_slice.h" struct heap { // The heap is divided into two halves for garbage collection. // buf holds the malloc'd heap buffer. value *buf; // active and standby are slices that partition buf. value_slice active; value_slice standby; size_t free_ptr; size_t last_free; value_slice gc_roots; }; struct heap new_heap(value_slice); value *alloc(struct heap *, int64_t); #endif