package core

  1. Overview
  2. Docs
Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source

Module Expert.AlarmSource

A GC alarm calls a user function at the end of each major GC cycle.

Sourcetype t
Sourceval sexp_of_t : t -> Sexplib0.Sexp.t
Sourceval create : (Base.Unit.t -> Base.Unit.t) -> t

create f arranges for f to be called at the end of each major GC cycle, starting with the current cycle or the next one. f can be called in any thread, and so introduces all the complexity of threading. f is called with Exn.handle_uncaught_and_exit, to prevent it from raising, because raising could raise to any allocation or GC point in any thread, which would be impossible to reason about.

Sourceval delete : t -> Base.Unit.t

delete t will stop the calls to the function associated to t. Calling delete t again has no effect.

OCaml

Innovation. Community. Security.