Skip to content

Commit

Permalink
Make partial_inst a global root. (#23507)
Browse files Browse the repository at this point in the history
Types in this list might not be rooted anywhere else.
  • Loading branch information
yuyichao authored and vtjnash committed Aug 30, 2017
1 parent 7f1623e commit 00e2075
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 3 deletions.
4 changes: 3 additions & 1 deletion src/gc.c
Original file line number Diff line number Diff line change
Expand Up @@ -1977,7 +1977,7 @@ module_binding: {
}

finlist: {
// Scan a finalizer list. see `gc_mark_finlist_t`
// Scan a finalizer (or format compatible) list. see `gc_mark_finlist_t`
gc_mark_finlist_t *finlist = gc_pop_markdata(&sp, gc_mark_finlist_t);
jl_value_t **begin = finlist->begin;
jl_value_t **end = finlist->end;
Expand Down Expand Up @@ -2276,6 +2276,8 @@ static void mark_roots(jl_gc_mark_cache_t *gc_cache, gc_mark_sp_t *sp)
// constants
gc_mark_queue_obj(gc_cache, sp, jl_typetype_type);
gc_mark_queue_obj(gc_cache, sp, jl_emptytuple_type);

gc_mark_queue_finlist(gc_cache, sp, &partial_inst, 0);
}

// find unmarked objects that need to be finalized from the finalizer list "list".
Expand Down
2 changes: 1 addition & 1 deletion src/gc.h
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ typedef struct {
uint8_t bits; // GC bits of the module (the bits to mark the binding buffer with)
} gc_mark_binding_t;

// Finalizer list
// Finalizer (or object) list
typedef struct {
jl_value_t **begin;
jl_value_t **end;
Expand Down
2 changes: 1 addition & 1 deletion src/jltypes.c
Original file line number Diff line number Diff line change
Expand Up @@ -1080,7 +1080,7 @@ static void check_datatype_parameters(jl_typename_t *tn, jl_value_t **params, si
JL_GC_POP();
}

static arraylist_t partial_inst;
arraylist_t partial_inst;
int inside_typedef = 0;

static jl_value_t *extract_wrapper(jl_value_t *t)
Expand Down
2 changes: 2 additions & 0 deletions src/julia_internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -1001,6 +1001,8 @@ extern jl_sym_t *isdefined_sym; extern jl_sym_t *nospecialize_sym;
void jl_register_fptrs(uint64_t sysimage_base, const char *base, const int32_t *offsets,
jl_method_instance_t **linfos, size_t n);

extern arraylist_t partial_inst;

#ifdef __cplusplus
}
#endif
Expand Down

0 comments on commit 00e2075

Please sign in to comment.