コード例 #1
0
ファイル: immix.hpp プロジェクト: Locke23rus/rubinius
      /**
       * Called when the immix::GC object wishes to mark an object.
       *
       * @returns true if the object is not already marked, and in the Immix
       * space; otherwise false.
       */
      inline bool mark_address(memory::Address addr, immix::MarkStack& ms, bool push = true) {
        Object* obj = addr.as<Object>();

        if(obj->marked_p(object_memory_->mark())) return false;
        obj->mark(object_memory_, object_memory_->mark());

        if(push) ms.push_back(addr);
        // If this is a young object, let the GC know not to try and mark
        // the block it's in.
        return obj->in_immix_p();
      }
コード例 #2
0
ファイル: immix.hpp プロジェクト: KensoDev/rubinius
      /**
       * Called when the immix::GC object wishes to mark an object.
       *
       * @returns true if the object is not already marked, and in the Immix
       * space; otherwise false.
       */
      bool mark_address(memory::Address addr, immix::MarkStack& ms) {
        Object* obj = addr.as<Object>();

        if(obj->marked_p(object_memory_->mark())) return false;
        obj->mark(object_memory_->mark());
        gc_->inc_marked_objects();

        ms.push_back(addr);
        if(obj->in_immix_p()) return true;

        // If this is a young object, let the GC know not to try and mark
        // the block it's in.
        return false;
      }
コード例 #3
0
ファイル: gc.cpp プロジェクト: AndreMeira/rubinius
    Object* call(Object* obj) {
      if(watched_p(obj)) {
        std::cout << "detected " << obj << " during unmarking.\n";
      }

      if(obj->reference_p() && obj->marked_p(object_memory_->mark())) {
        obj->clear_mark();
        stack_.push_back(obj);
      }

      return obj;
    }
コード例 #4
0
ファイル: immix.hpp プロジェクト: Locke23rus/rubinius
 memory::Address update_pointer(memory::Address addr) {
   Object* obj = addr.as<Object>();
   if(!obj) return memory::Address::null();
   if(obj->young_object_p()) {
     if(obj->forwarded_p()) return obj->forward();
     return memory::Address::null();
   } else {
     // we must remember this because it might
     // contain references to young gen objects
     object_memory_->remember_object(obj);
   }
   return addr;
 }
コード例 #5
0
ファイル: objectmemory.hpp プロジェクト: Emily/rubinius
 ~GCInhibit() {
   om_->allow_gc();
 }