Permalink
Browse files

Initialize inflated header marks with current mark

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...
1 parent c41e3a6 commit 76039182e837d2e1460e008f2d11515d27e499cc @dbussink dbussink committed May 30, 2013
Showing with 6 additions and 0 deletions.
  1. +6 −0 vm/objectmemory.cpp
View
@@ -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;
@@ -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
@@ -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();
@@ -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;
@@ -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;

0 comments on commit 7603918

Please sign in to comment.