Skip to content

Commit

Permalink
Update collector->object_frames to reflect object_list move
Browse files Browse the repository at this point in the history
  • Loading branch information
joshuay03 committed Oct 24, 2024
1 parent 5b0579f commit 162275e
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion ext/vernier/vernier.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1554,7 +1554,16 @@ class RetainedCollector : public BaseCollector {
void compact() {
RetainedCollector *collector = this;
for (auto& obj: collector->object_list) {
obj = rb_gc_location(obj);
VALUE reloc_obj = rb_gc_location(obj);

const auto search = collector->object_frames.find(obj);
if (search != collector->object_frames.end()) {
int stack_index = search->second;
collector->object_frames.erase(search);
collector->object_frames.emplace(reloc_obj, stack_index);
}

obj = reloc_obj;
}
}
};
Expand Down

0 comments on commit 162275e

Please sign in to comment.