Fix test c-api/alloc_async_stubs.c.

We must wait for two major cycles to finish in order to make sure that finalizers have indeed be examined.
master
Jacques-Henri Jourdan 2019-11-21 16:42:32 +01:00
parent 975bc47f51
commit d5d972d377
1 changed files with 2 additions and 2 deletions

View File

@ -12,9 +12,9 @@ value stub(value ref)
printf("C, before: %d\n", Int_val(Field(ref, 0)));
/* First, do enough major allocation to trigger a major collection */
/* First, do enough major allocations to do a full major collection cycle */
coll_before = Caml_state_field(stat_major_collections);
while (Caml_state_field(stat_major_collections) == coll_before) {
while (Caml_state_field(stat_major_collections) <= coll_before+1) {
caml_alloc(10000, 0);
}