Skip to content

Commit c9eaaa6

Browse files
committed
Keep trying gc
1 parent a737d28 commit c9eaaa6

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

src/dump.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2294,7 +2294,7 @@ static void jl_insert_methods(jl_array_t *list)
22942294
}
22952295
}
22962296

2297-
extern jl_array_t *_jl_debug_method_invalidation;
2297+
extern jl_array_t *_jl_debug_method_invalidation JL_GLOBALLY_ROOTED;
22982298

22992299
// verify that these edges intersect with the same methods as before
23002300
static void jl_verify_edges(jl_array_t *targets, jl_array_t **pvalids)
@@ -2349,7 +2349,7 @@ static void jl_insert_backedges(jl_array_t *list, jl_array_t *targets)
23492349
size_t i, l = jl_array_len(list);
23502350
jl_array_t *valids = NULL;
23512351
jl_value_t *loctag = NULL;
2352-
JL_GC_PUSH3(&valids, &_jl_debug_method_invalidation, &loctag);
2352+
JL_GC_PUSH2(&valids, &loctag);
23532353
jl_verify_edges(targets, &valids);
23542354
for (i = 0; i < l; i += 2) {
23552355
jl_method_instance_t *caller = (jl_method_instance_t*)jl_array_ptr_ref(list, i);

src/gf.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1488,6 +1488,9 @@ static void update_max_args(jl_methtable_t *mt, jl_value_t *type)
14881488
jl_array_t *_jl_debug_method_invalidation JL_GLOBALLY_ROOTED = NULL;
14891489
JL_DLLEXPORT jl_value_t *jl_debug_method_invalidation(int state)
14901490
{
1491+
/* After calling with `state = 1`, caller is responsible for
1492+
holding a reference to the returned array until this is called
1493+
again with `state = 0`. */
14911494
if (state) {
14921495
if (_jl_debug_method_invalidation)
14931496
return (jl_value_t*) _jl_debug_method_invalidation;
@@ -1503,7 +1506,7 @@ static void invalidate_method_instance(jl_method_instance_t *replaced, size_t ma
15031506
{
15041507
if (_jl_debug_method_invalidation) {
15051508
jl_value_t *boxeddepth = NULL;
1506-
JL_GC_PUSH2(&_jl_debug_method_invalidation, boxeddepth);
1509+
JL_GC_PUSH1(&boxeddepth);
15071510
jl_array_ptr_1d_push(_jl_debug_method_invalidation, (jl_value_t*)replaced);
15081511
boxeddepth = jl_box_int32(depth);
15091512
jl_array_ptr_1d_push(_jl_debug_method_invalidation, boxeddepth);
@@ -1637,7 +1640,7 @@ static int invalidate_mt_cache(jl_typemap_entry_t *oldentry, void *closure0)
16371640
if (intersects) {
16381641
if (_jl_debug_method_invalidation) {
16391642
jl_value_t *loctag = NULL;
1640-
JL_GC_PUSH2(&_jl_debug_method_invalidation, &loctag);
1643+
JL_GC_PUSH1(&loctag);
16411644
jl_array_ptr_1d_push(_jl_debug_method_invalidation, (jl_value_t*)mi);
16421645
loctag = jl_cstr_to_string("mt");
16431646
jl_gc_wb(_jl_debug_method_invalidation, loctag);
@@ -1710,7 +1713,7 @@ JL_DLLEXPORT void jl_method_table_insert(jl_methtable_t *mt, jl_method_t *method
17101713
method->primary_world = ++jl_world_counter;
17111714
size_t max_world = method->primary_world - 1;
17121715
int invalidated = 0;
1713-
JL_GC_PUSH2(&oldvalue, &_jl_debug_method_invalidation);
1716+
JL_GC_PUSH1(&oldvalue);
17141717
JL_LOCK(&mt->writelock);
17151718
// first delete the existing entry (we'll disable it later)
17161719
struct jl_typemap_assoc search = {(jl_value_t*)type, method->primary_world, NULL, 0, ~(size_t)0};

0 commit comments

Comments
 (0)