@@ -852,7 +852,7 @@ static void custom_finalize_minor (caml_domain_state * domain)
852
852
}
853
853
}
854
854
855
- static void dependent_finalize_minor (caml_domain_state * domain )
855
+ static void dependent_accounting_minor (caml_domain_state * domain )
856
856
{
857
857
struct caml_dependent_elt * elt ;
858
858
for (elt = domain -> minor_tables -> dependent .base ;
@@ -861,20 +861,16 @@ static void dependent_finalize_minor (caml_domain_state *domain)
861
861
CAMLassert (Is_block (* v ));
862
862
if (Is_young (* v )) {
863
863
if (get_header_val (* v ) == 0 ) { /* value copied to major heap */
864
- #ifdef DEBUG
865
- domain -> minor_dependent_bsz -= elt -> mem ;
866
- /* see assertion below */
867
- #endif
868
864
/* inlined version of [caml_alloc_dependent_memory] */
869
865
domain -> allocated_dependent_bytes += elt -> mem ;
870
866
domain -> stat_promoted_dependent_bytes += elt -> mem ;
871
867
caml_add_dependent_bytes (domain -> shared_heap , elt -> mem );
872
868
}
873
869
}
874
870
}
875
- /* At this point, everything must be finalized or promoted. */
876
- CAMLassert ( domain -> minor_dependent_bsz == 0 );
877
- domain -> minor_dependent_bsz = 0 ;
871
+ /* Don't touch minor_dependent_bsz() as it's outside our control
872
+ (controlled by caml_alloc/free_dependent_memory). It's cleared
873
+ at the end of the collection. */
878
874
}
879
875
880
876
/* Increment the counter non-atomically, when it is already known that this
@@ -990,7 +986,7 @@ caml_stw_empty_minor_heap_no_major_slice(caml_domain_state* domain,
990
986
991
987
CAML_EV_BEGIN (EV_MINOR_DEPENDENT );
992
988
caml_gc_log ("accounting for minor blocks with dependent memory" );
993
- dependent_finalize_minor (domain );
989
+ dependent_accounting_minor (domain );
994
990
CAML_EV_END (EV_MINOR_DEPENDENT );
995
991
996
992
CAML_EV_BEGIN (EV_MINOR_FINALIZERS_ADMIN );
0 commit comments