Skip to content

Commit

Permalink
Remove caml_memprof_handle_postponed_exn
Browse files Browse the repository at this point in the history
Signed-off-by: Anurag Soni <[email protected]>
  • Loading branch information
anuragsoni committed Oct 7, 2022
1 parent 23e609f commit 2e350ea
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 10 deletions.
3 changes: 0 additions & 3 deletions core/src/gc.ml
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,6 @@ external major_collections : unit -> int = "core_gc_major_collections" [@@noallo
external compactions : unit -> int = "core_gc_compactions" [@@noalloc]
external major_plus_minor_words : unit -> int = "core_gc_major_plus_minor_words"
external allocated_words : unit -> int = "core_gc_allocated_words"
external run_memprof_callbacks : unit -> unit = "core_gc_run_memprof_callbacks"

let zero = Sys.opaque_identity (int_of_string "0")

Expand Down Expand Up @@ -513,11 +512,9 @@ module For_testing = struct
(* Memprof.stop does not guarantee that all memprof callbacks are run (some may be
delayed if they happened during C code and there has been no allocation since),
so we explictly flush them *)
run_memprof_callbacks ();
Caml.Gc.Memprof.stop ();
x
| exception e ->
run_memprof_callbacks ();
Caml.Gc.Memprof.stop ();
raise e
in
Expand Down
7 changes: 0 additions & 7 deletions core/src/gc_stubs.c
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,3 @@ CAMLprim value core_gc_allocated_words(value unit __attribute__((unused)))
{
return Val_long(minor_words() + major_words() - promoted_words());
}

CAMLprim value core_gc_run_memprof_callbacks(value unit __attribute__((unused)))
{
value exn = caml_memprof_handle_postponed_exn();
caml_raise_if_exception(exn);
return Val_unit;
}

0 comments on commit 2e350ea

Please sign in to comment.