package core_kernel

  1. Overview
  2. Docs
Industrial strength alternative to OCaml's standard library

Install

dune-project
 Dependency

Authors

Maintainers

Sources

v0.14.2.tar.gz
sha256=66f5353964d35a994ec7fdc88fe60ae5d497ac89a8042786f3e37d9e2202ce4b
md5=ede2f6d22eaa8320f88bac67d41b5cff

doc/core_kernel.weak_pointer/Weak_pointer/index.html

Module Weak_pointerSource

A weak pointer is a pointer to a heap block that does not cause the heap block to remain live during garbage collection.

If the block would otherwise remain live, then the weak pointer remains pointed to the block. If the block is collected, then the weak pointer is cleared.

Sourcetype 'a t
Sourceval sexp_of_t : ('a -> Ppx_sexp_conv_lib.Sexp.t) -> 'a t -> Ppx_sexp_conv_lib.Sexp.t
Sourceval create : unit -> _ t

create creates an empty weak pointer. One must set it to point it to something.

Sourceval get : 'a t -> 'a Core_kernel.Heap_block.t option
Sourceval is_some : _ t -> bool

is_some t = Option.is_some (get t).

Sourceval is_none : _ t -> bool

is_none t = Option.is_none (get t).

Sourceval set : 'a t -> 'a Core_kernel.Heap_block.t -> unit