vm: fix 'become' when aging space is empty

db4
Slava Pestov 2009-11-05 23:53:53 -06:00
parent 00ce8b6a33
commit b011295300
3 changed files with 21 additions and 22 deletions

View File

@ -38,13 +38,13 @@ inline cell log2(cell x)
#else
cell n = 0;
#ifdef FACTOR_64
if (x >= (u64)1 << 32) { x >>= 32; n += 32; }
if (x >= (cell)1 << 32) { x >>= 32; n += 32; }
#endif
if (x >= (u32)1 << 16) { x >>= 16; n += 16; }
if (x >= (u32)1 << 8) { x >>= 8; n += 8; }
if (x >= (u32)1 << 4) { x >>= 4; n += 4; }
if (x >= (u32)1 << 2) { x >>= 2; n += 2; }
if (x >= (u32)1 << 1) { n += 1; }
if (x >= (cell)1 << 16) { x >>= 16; n += 16; }
if (x >= (cell)1 << 8) { x >>= 8; n += 8; }
if (x >= (cell)1 << 4) { x >>= 4; n += 4; }
if (x >= (cell)1 << 2) { x >>= 2; n += 2; }
if (x >= (cell)1 << 1) { n += 1; }
#endif
return n;
}

View File

@ -226,12 +226,8 @@ template<typename TargetGeneration, typename Policy> struct collector {
end = start + ((object *)start)->size();
}
#ifdef FACTOR_DEBUG
assert(addr_to_card(start - data->start) <= card_index);
assert(start < card_end_address(card_index));
#endif
scan_next_object: {
scan_next_object: if(start < card_end_address(card_index))
{
trace_partial_objects(
start,
binary_start,

View File

@ -22,9 +22,12 @@ void factor_vm::collect_nursery()
collector.trace_cards(data->tenured,
card_points_to_nursery,
simple_unmarker(card_points_to_nursery));
if(data->aging->here != data->aging->start)
{
collector.trace_cards(data->aging,
card_points_to_nursery,
full_unmarker());
}
current_gc->event->ended_card_scan(collector.cards_scanned,collector.decks_scanned);
current_gc->event->started_code_scan();