Skip to content

Commit 00e2075

Browse files
yuyichaovtjnash
authored andcommitted
Make partial_inst a global root. (#23507)
Types in this list might not be rooted anywhere else.
1 parent 7f1623e commit 00e2075

File tree

4 files changed

+7
-3
lines changed

4 files changed

+7
-3
lines changed

src/gc.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1977,7 +1977,7 @@ module_binding: {
19771977
}
19781978

19791979
finlist: {
1980-
// Scan a finalizer list. see `gc_mark_finlist_t`
1980+
// Scan a finalizer (or format compatible) list. see `gc_mark_finlist_t`
19811981
gc_mark_finlist_t *finlist = gc_pop_markdata(&sp, gc_mark_finlist_t);
19821982
jl_value_t **begin = finlist->begin;
19831983
jl_value_t **end = finlist->end;
@@ -2276,6 +2276,8 @@ static void mark_roots(jl_gc_mark_cache_t *gc_cache, gc_mark_sp_t *sp)
22762276
// constants
22772277
gc_mark_queue_obj(gc_cache, sp, jl_typetype_type);
22782278
gc_mark_queue_obj(gc_cache, sp, jl_emptytuple_type);
2279+
2280+
gc_mark_queue_finlist(gc_cache, sp, &partial_inst, 0);
22792281
}
22802282

22812283
// find unmarked objects that need to be finalized from the finalizer list "list".

src/gc.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ typedef struct {
188188
uint8_t bits; // GC bits of the module (the bits to mark the binding buffer with)
189189
} gc_mark_binding_t;
190190

191-
// Finalizer list
191+
// Finalizer (or object) list
192192
typedef struct {
193193
jl_value_t **begin;
194194
jl_value_t **end;

src/jltypes.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1080,7 +1080,7 @@ static void check_datatype_parameters(jl_typename_t *tn, jl_value_t **params, si
10801080
JL_GC_POP();
10811081
}
10821082

1083-
static arraylist_t partial_inst;
1083+
arraylist_t partial_inst;
10841084
int inside_typedef = 0;
10851085

10861086
static jl_value_t *extract_wrapper(jl_value_t *t)

src/julia_internal.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1001,6 +1001,8 @@ extern jl_sym_t *isdefined_sym; extern jl_sym_t *nospecialize_sym;
10011001
void jl_register_fptrs(uint64_t sysimage_base, const char *base, const int32_t *offsets,
10021002
jl_method_instance_t **linfos, size_t n);
10031003

1004+
extern arraylist_t partial_inst;
1005+
10041006
#ifdef __cplusplus
10051007
}
10061008
#endif

0 commit comments

Comments
 (0)