Skip to content

Commit

Permalink
faster valid object lookup in conservative gc
Browse files Browse the repository at this point in the history
  • Loading branch information
d-netto committed Jul 21, 2023
1 parent bf00ff4 commit 5d28a43
Showing 1 changed file with 3 additions and 11 deletions.
14 changes: 3 additions & 11 deletions src/gc.c
Original file line number Diff line number Diff line change
Expand Up @@ -4070,18 +4070,10 @@ JL_DLLEXPORT jl_value_t *jl_gc_internal_obj_base_ptr(void *p)
// before the freelist pointer was either live during the last
// sweep or has been allocated since.
if (gc_page_data(cell) == gc_page_data(pool->freelist)
&& (char *)cell < (char *)pool->freelist) {
&& (char *)cell < (char *)pool->freelist)
goto valid_object;
}
else {
jl_taggedvalue_t *v = pool->freelist;
while (v != NULL) {
if (v == cell) {
return NULL;
}
v = v->next;
}
}
else
return NULL;
// Not a freelist entry, therefore a valid object.
valid_object:
// We have to treat objects with type `jl_buff_tag` differently,
Expand Down

0 comments on commit 5d28a43

Please sign in to comment.