@@ -68,7 +68,6 @@ namespace rubinius {
6868 , mature_gc_in_progress_(false )
6969 , slab_size_(4096 )
7070 , interrupt_flag_(false )
71- , collect_young_flag_(false )
7271 , collect_full_flag_(false )
7372 , last_object_id(1 )
7473 , last_snapshot_id(0 )
@@ -82,6 +81,8 @@ namespace rubinius {
8281 }
8382#endif
8483
84+ state->shared ().set_memory (this );
85+
8586 for (size_t i = 0 ; i < LastObjectType; i++) {
8687 type_info[i] = NULL ;
8788 }
@@ -100,7 +101,6 @@ namespace rubinius {
100101
101102 delete immix_;
102103 delete mark_sweep_;
103- /* delete young_; */
104104
105105 for (std::list<capi::GlobalHandle*>::iterator i = global_capi_handle_locations_.begin ();
106106 i != global_capi_handle_locations_.end (); ++i) {
@@ -421,26 +421,6 @@ namespace rubinius {
421421 }
422422 }
423423
424- bool Memory::refill_slab (STATE, memory::Slab& slab) {
425- utilities::thread::SpinLock::LockGuard guard (allocation_lock_);
426-
427- memory::Address addr = memory::Address::null (); /* young_->allocate_for_slab(slab_size_); */
428-
429- metrics::MetricsData& metrics = state->vm ()->metrics ();
430- metrics.memory .young_objects += slab.allocations ();
431- metrics.memory .young_bytes += slab.bytes_used ();
432-
433- if (addr) {
434- slab.refill (addr, slab_size_);
435- metrics.memory .slab_refills ++;
436- return true ;
437- } else {
438- slab.refill (0 , 0 );
439- metrics.memory .slab_refills_fails ++;
440- return false ;
441- }
442- }
443-
444424 bool Memory::valid_object_p (STATE, Object* obj) {
445425 if (obj->true_p ()) {
446426 return true ;
@@ -454,8 +434,6 @@ namespace rubinius {
454434 return true ;
455435 } else if (obj->symbol_p ()) {
456436 return true ;
457- } else if (obj->young_object_p ()) {
458- return false ; /* young_->validate_object(obj) == cValid; */
459437 } else if (obj->mature_object_p ()) {
460438 if (obj->in_immix_p ()) {
461439 if (immix_->validate_object (state, obj) == cInImmix) {
@@ -511,76 +489,24 @@ namespace rubinius {
511489 * prohibition lifts, a GC will eventually be triggered again.
512490 */
513491 if (!can_gc ()) {
514- collect_young_flag_ = false ;
515492 collect_full_flag_ = false ;
516493 interrupt_flag_ = false ;
517494 return ;
518495 }
519496
520- if (!collect_young_flag_ && ! collect_full_flag_) return ;
497+ if (!collect_full_flag_) return ;
521498
522499 if (cDebugThreading) {
523500 std::cerr << std::endl << " [" << state
524501 << " WORLD beginning GC.]" << std::endl;
525502 }
526503
527- if (collect_young_flag_) {
528- memory::GCData gc_data (state);
529-
530- RUBINIUS_GC_BEGIN (0 );
531- collect_young (state, &gc_data);
532-
533- if (!collect_full_flag_) interrupt_flag_ = false ;
534-
535- RUBINIUS_GC_END (0 );
536- }
537-
538504 if (collect_full_flag_) {
539505 RUBINIUS_GC_BEGIN (1 );
540506 collect_full (state);
541507 }
542508 }
543509
544- void Memory::collect_young (STATE, memory::GCData* data) {
545- timer::StopWatch<timer::milliseconds> timerx (
546- state->vm ()->metrics ().gc .young_ms );
547-
548- /*
549- young_->collect(data);
550-
551- prune_handles(state, data->handles(), data->cached_handles(), young_);
552-
553- metrics::MetricsData& metrics = state->vm()->metrics();
554- metrics.gc.young_count++;
555-
556- data->global_cache()->prune_young();
557-
558- {
559- std::lock_guard<std::mutex> guard(data->thread_nexus()->threads_mutex());
560-
561- for(ThreadList::iterator i = data->thread_nexus()->threads()->begin();
562- i != data->thread_nexus()->threads()->end();
563- ++i)
564- {
565- memory::Slab& slab = (*i)->local_slab();
566-
567- // Reset the slab to a size of 0 so that the thread has to do
568- // an allocation to get a proper refill. This keeps the number
569- // of threads in the system from starving the available
570- // number of slabs.
571- slab.refill(0, 0);
572- }
573- }
574-
575- young_->reset();
576- #ifdef RBX_GC_DEBUG
577- young_->verify(data);
578- #endif
579- */
580-
581- collect_young_flag_ = false ;
582- }
583-
584510 void Memory::collect_full (STATE) {
585511 // If we're already collecting, ignore this request
586512 if (mature_gc_in_progress_) return ;
@@ -634,7 +560,7 @@ namespace rubinius {
634560
635561 data->global_cache ()->prune_unmarked (mark ());
636562
637- prune_handles (state, data->handles (), data->cached_handles (), NULL );
563+ prune_handles (state, data->handles (), data->cached_handles ());
638564
639565 // Have to do this after all things that check for mark bits is
640566 // done, as it free()s objects, invalidating mark bits.
@@ -723,10 +649,8 @@ namespace rubinius {
723649
724650 }
725651
726- void Memory::prune_handles (STATE, capi::Handles* handles,
727- std::list<capi::Handle*>* cached, /* BakerGC */ void * young)
728- {
729- handles->deallocate_handles (cached, mark (), young);
652+ void Memory::prune_handles (STATE, capi::Handles* handles, std::list<capi::Handle*>* cached) {
653+ handles->deallocate_handles (cached, mark ());
730654 }
731655
732656 void Memory::add_type_info (STATE, TypeInfo* ti) {
@@ -793,11 +717,6 @@ namespace rubinius {
793717 ObjectPosition Memory::validate_object (STATE, Object* obj) {
794718 ObjectPosition pos;
795719
796- /*
797- pos = young_->validate_object(obj);
798- if(pos != cUnknown) return pos;
799- */
800-
801720 pos = immix_->validate_object (state, obj);
802721 if (pos != cUnknown) return pos;
803722
0 commit comments