Skip to content

Commit

Permalink
Initialize inflated header marks with current mark
Browse files Browse the repository at this point in the history
This ensures that we always see these as used. This does result in
inflated header potentially surviving one GC cycle longer, but this is
usually unlikely for objects that get inflated.
  • Loading branch information
dbussink committed May 31, 2013
1 parent c41e3a6 commit 7603918
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions vm/objectmemory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ namespace rubinius {
InflatedHeader* ih = inflated_headers_->allocate(obj, &ih_header);
ih->update(state, orig);
ih->initialize_mutex(state->vm()->thread_id(), count);
ih->mark(this, mark_);

while(!obj->set_inflated_header(state, ih_header, orig)) {
orig = obj->header;
Expand Down Expand Up @@ -329,6 +330,7 @@ namespace rubinius {
}

ih->initialize_mutex(state->vm()->thread_id(), initial_count);
ih->mark(this, mark_);

while(!obj->set_inflated_header(state, ih_index, orig)) {
// The header can't have been inflated by another thread, the
Expand Down Expand Up @@ -398,6 +400,8 @@ namespace rubinius {
return false;
}

ih->mark(this, mark_);

// Try it all over again if it fails.
if(!obj->set_inflated_header(state, ih_header, orig)) {
ih->clear();
Expand Down Expand Up @@ -667,6 +671,7 @@ namespace rubinius {
InflatedHeader* ih = inflated_headers_->allocate(obj, &ih_index);
ih->update(state, orig);
ih->set_object_id(id);
ih->mark(this, mark_);

while(!obj->set_inflated_header(state, ih_index, orig)) {
orig = obj->header;
Expand Down Expand Up @@ -696,6 +701,7 @@ namespace rubinius {
InflatedHeader* ih = inflated_headers_->allocate(obj, &ih_index);
ih->update(state, orig);
ih->set_handle(state, handle);
ih->mark(this, mark_);

while(!obj->set_inflated_header(state, ih_index, orig)) {
orig = obj->header;
Expand Down

0 comments on commit 7603918

Please sign in to comment.