Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Use a std::map for marking rather than the header

  • Loading branch information...
commit 78cdc9dccdf1d12f24e1898e2f2763fda099f9e0 1 parent 3016598
Evan Phoenix authored
Showing with 4 additions and 5 deletions.
  1. +3 −5 vm/gc/walker.cpp
  2. +1 −0  vm/gc/walker.hpp
8 vm/gc/walker.cpp
View
@@ -5,16 +5,14 @@
namespace rubinius {
ObjectWalker::~ObjectWalker() {
- object_memory_->rotate_mark();
}
Object* ObjectWalker::saw_object(Object* obj) {
- int mark = object_memory_->mark();
-
if(obj->reference_p()) {
- if(!obj->marked_p(mark)) {
+ std::map<Object*,bool>::iterator i = mark_bits_.find(obj);
+ if(i == mark_bits_.end()) {
stack_.push_back(obj);
- obj->mark(mark);
+ mark_bits_[obj] = true;
}
}
1  vm/gc/walker.hpp
View
@@ -8,6 +8,7 @@
namespace rubinius {
class ObjectWalker : public GarbageCollector {
std::vector<Object*> stack_;
+ std::map<Object*, bool> mark_bits_;
public:
ObjectWalker(ObjectMemory* om)
Please sign in to comment.
Something went wrong with that request. Please try again.