@@ -1488,6 +1488,9 @@ static void update_max_args(jl_methtable_t *mt, jl_value_t *type)
1488
1488
jl_array_t * _jl_debug_method_invalidation JL_GLOBALLY_ROOTED = NULL ;
1489
1489
JL_DLLEXPORT jl_value_t * jl_debug_method_invalidation (int state )
1490
1490
{
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`. */
1491
1494
if (state ) {
1492
1495
if (_jl_debug_method_invalidation )
1493
1496
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
1503
1506
{
1504
1507
if (_jl_debug_method_invalidation ) {
1505
1508
jl_value_t * boxeddepth = NULL ;
1506
- JL_GC_PUSH2 ( & _jl_debug_method_invalidation , boxeddepth );
1509
+ JL_GC_PUSH1 ( & boxeddepth );
1507
1510
jl_array_ptr_1d_push (_jl_debug_method_invalidation , (jl_value_t * )replaced );
1508
1511
boxeddepth = jl_box_int32 (depth );
1509
1512
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)
1637
1640
if (intersects ) {
1638
1641
if (_jl_debug_method_invalidation ) {
1639
1642
jl_value_t * loctag = NULL ;
1640
- JL_GC_PUSH2 ( & _jl_debug_method_invalidation , & loctag );
1643
+ JL_GC_PUSH1 ( & loctag );
1641
1644
jl_array_ptr_1d_push (_jl_debug_method_invalidation , (jl_value_t * )mi );
1642
1645
loctag = jl_cstr_to_string ("mt" );
1643
1646
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
1710
1713
method -> primary_world = ++ jl_world_counter ;
1711
1714
size_t max_world = method -> primary_world - 1 ;
1712
1715
int invalidated = 0 ;
1713
- JL_GC_PUSH2 (& oldvalue , & _jl_debug_method_invalidation );
1716
+ JL_GC_PUSH1 (& oldvalue );
1714
1717
JL_LOCK (& mt -> writelock );
1715
1718
// first delete the existing entry (we'll disable it later)
1716
1719
struct jl_typemap_assoc search = {(jl_value_t * )type , method -> primary_world , NULL , 0 , ~(size_t )0 };
0 commit comments