@@ -510,19 +510,6 @@ static void add_node_to_roots_buffer(RootsWorkClosure* closure, RootsWorkBuffer*
510
510
}
511
511
}
512
512
513
- static void add_node_to_tpinned_roots_buffer (RootsWorkClosure * closure , RootsWorkBuffer * buf , size_t * buf_len , void * root ) {
514
- if (root == NULL )
515
- return ;
516
-
517
- buf -> ptr [* buf_len ] = root ;
518
- * buf_len += 1 ;
519
- if (* buf_len >= buf -> cap ) {
520
- RootsWorkBuffer new_buf = (closure -> report_tpinned_nodes_func )(buf -> ptr , * buf_len , buf -> cap , closure -> data , true);
521
- * buf = new_buf ;
522
- * buf_len = 0 ;
523
- }
524
- }
525
-
526
513
// staticdata_utils.c
527
514
extern jl_array_t * internal_methods ;
528
515
extern jl_array_t * newly_inferred ;
@@ -824,15 +811,8 @@ JL_DLLEXPORT void jl_gc_scan_vm_specific_roots(RootsWorkClosure* closure)
824
811
// add_node_to_roots_buffer(closure, &buf, &len, cmpswap_names);
825
812
// add_node_to_roots_buffer(closure, &buf, &len, precompile_field_replace);
826
813
827
- // jl_global_roots_table must be transitively pinned
828
- // FIXME: We need to remove transitive pinning of global roots. Otherwise they may pin most of the objects in the heap.
829
- RootsWorkBuffer tpinned_buf = (closure -> report_tpinned_nodes_func )((void * * )0 , 0 , 0 , closure -> data , true);
830
- size_t tpinned_len = 0 ;
831
- add_node_to_tpinned_roots_buffer (closure , & tpinned_buf , & tpinned_len , jl_global_roots_list );
832
- add_node_to_tpinned_roots_buffer (closure , & tpinned_buf , & tpinned_len , jl_global_roots_keyset );
833
814
// Push the result of the work.
834
815
(closure -> report_nodes_func )(buf .ptr , len , buf .cap , closure -> data , false);
835
- (closure -> report_tpinned_nodes_func )(tpinned_buf .ptr , tpinned_len , tpinned_buf .cap , closure -> data , false);
836
816
}
837
817
838
818
JL_DLLEXPORT void jl_gc_scan_julia_exc_obj (void * obj_raw , void * closure , ProcessSlotFn process_slot ) {
@@ -1086,6 +1066,7 @@ JL_DLLEXPORT jl_weakref_t *jl_gc_new_weakref_th(jl_ptls_t ptls, jl_value_t *valu
1086
1066
{
1087
1067
jl_weakref_t * wr = (jl_weakref_t * )jl_gc_alloc (ptls , sizeof (void * ), jl_weakref_type );
1088
1068
wr -> value = value ; // NOTE: wb not needed here
1069
+ OBJ_PIN (wr )
1089
1070
// Note: we are using MMTk's weak ref processing. If we switch to Julia's weak ref processing,
1090
1071
// we need to make sure the value and the weak ref won't be moved (e.g. pin them)
1091
1072
mmtk_add_weak_candidate (wr );
0 commit comments