module Make:
Build a new disposal registry. The Disposal.DISPOSABLE
parameter D
specifies how to dispose objects of type D.t
.
type
data
The type of data being managed.
val register : (data -> unit) ->
data -> data
Register a disposal function for a particular object.
Returns the object.
val manage : ?disposer:(data -> unit) ->
data -> data
Request that the garbage collector manage an object. If no
disposal action is given, uses D.default
. When the object
is collected, the disposal action will be run if the user hasn't
called it manually first (or possibly again, if it's the default
disposer).
val dispose : data -> unit
Manually dispose an object now. If the object is not registered,
uses D.default.