Object* ImmixGC::saw_object(Object* obj) { if(watched_p(obj)) { std::cout << "detected " << obj << " during immix scanning.\n"; } immix::Address fwd = gc_.mark_address(immix::Address(obj), allocator_); Object* copy = fwd.as<Object>(); // Check and update an inflated header if(copy && copy != obj && obj->inflated_header_p()) { InflatedHeader* ih = obj->deflate_header(); ih->reset_object(copy); copy->set_inflated_header(ih); } return copy; }
Object* ImmixGC::saw_object(Object* obj) { #ifdef ENABLE_OBJECT_WATCH if(watched_p(obj)) { std::cout << "detected " << obj << " during immix scanning.\n"; } #endif if(!obj->reference_p()) return obj; memory::Address fwd = gc_.mark_address(memory::Address(obj), allocator_); Object* copy = fwd.as<Object>(); // Check and update an inflated header if(copy && copy != obj && obj->inflated_header_p()) { InflatedHeader* ih = obj->deflate_header(); ih->reset_object(copy); if(!copy->set_inflated_header(ih)) { rubinius::bug("Massive IMMIX inflated header screwup."); } } return copy; }