CELL heap_start; CELL heap_end; /* card marking write barrier. a card is a byte storing a mark flag, and the offset (in cells) of the first object in the card. the mark flag is set by the write barrier when an object in the card has a slot written to. the offset of the first object is set by the allocator. */ #define CARD_MARK_MASK 0x80 #define CARD_BASE_MASK 0x7f typedef u8 CARD; CARD *cards; CARD *cards_end; /* A card is 16 bytes (128 bits), 5 address bits per card. it is important that 7 bits is sufficient to represent every offset within the card */ #define CARD_SIZE 128 #define CARD_BITS 7 #define ADDR_CARD_MASK (CARD_SIZE-1) INLINE CARD card_marked(CARD c) { return c & CARD_MARK_MASK; } INLINE void unmark_card(CARD *c) { *c &= CARD_BASE_MASK; } INLINE void clear_card(CARD *c) { *c = CARD_BASE_MASK; /* invalid value */ } INLINE u8 card_base(CARD c) { return c & CARD_BASE_MASK; } #ifdef FACTOR_PPC register CELL cards_offset asm("r16"); #else CELL cards_offset; #endif #define ADDR_TO_CARD(a) (CARD*)(((CELL)a >> CARD_BITS) + cards_offset) #define CARD_TO_ADDR(c) (CELL*)(((CELL)c - cards_offset)<