Commit ca1266aa authored by Marius Wachtler's avatar Marius Wachtler

GC: use use visitRange more often

parent 850df400
...@@ -60,7 +60,7 @@ class TraceStack { ...@@ -60,7 +60,7 @@ class TraceStack {
} }
void reserve(int num) { void reserve(int num) {
v.reserve(num + size()); v.reserve(num + v.size());
} }
void* pop() { void* pop() {
......
...@@ -80,9 +80,7 @@ extern "C" void hcBoxGCHandler(GCVisitor *v, void* p) { ...@@ -80,9 +80,7 @@ extern "C" void hcBoxGCHandler(GCVisitor *v, void* p) {
HCBox::AttrList *attr_list = b->attr_list; HCBox::AttrList *attr_list = b->attr_list;
assert(attr_list); assert(attr_list);
v->visit(attr_list); v->visit(attr_list);
for (int i = 0; i < nattrs; i++) { v->visitRange((void**)&attr_list->attrs[0], (void**)&attr_list->attrs[nattrs]);
v->visit(attr_list->attrs[i]);
}
} }
} }
...@@ -127,8 +125,8 @@ extern "C" void tupleGCHandler(GCVisitor *v, void* p) { ...@@ -127,8 +125,8 @@ extern "C" void tupleGCHandler(GCVisitor *v, void* p) {
BoxedTuple *t = (BoxedTuple*)p; BoxedTuple *t = (BoxedTuple*)p;
int size = t->elts.size(); int size = t->elts.size();
for (int i = 0; i < size; i++) { if (size) {
v->visit(t->elts[i]); v->visitRange((void**)&t->elts[0], (void**)&t->elts[size]);
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment