Skip to content

Instantly share code, notes, and snippets.

@tenderlove
Created June 24, 2020 20:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tenderlove/ca28d1ededf049c2d768d51c5201b8f3 to your computer and use it in GitHub Desktop.
Save tenderlove/ca28d1ededf049c2d768d51c5201b8f3 to your computer and use it in GitHub Desktop.
struct heap_page {
short total_slots;
short free_slots;
short pinned_slots;
short final_slots;
struct {
unsigned int before_sweep : 1;
unsigned int has_remembered_objects : 1;
unsigned int has_uncollectible_shady_objects : 1;
unsigned int in_tomb : 1;
} flags;
struct heap_page *free_next;
RVALUE *start;
RVALUE *freelist;
struct list_node page_node;
bits_t wb_unprotected_bits[HEAP_PAGE_BITMAP_LIMIT];
/* the following three bitmaps are cleared at the beginning of full GC */
bits_t mark_bits[HEAP_PAGE_BITMAP_LIMIT];
bits_t uncollectible_bits[HEAP_PAGE_BITMAP_LIMIT];
bits_t marking_bits[HEAP_PAGE_BITMAP_LIMIT];
/* If set, the object is not movable */
bits_t pinned_bits[HEAP_PAGE_BITMAP_LIMIT];
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment