Weak_arrayModule for dealing with weak pointers, i.e., pointers that don't prevent garbage collection of what they point to.
This module is like the OCaml standard library module of the same name, except that it requires that the values in the weak set are heap blocks.
val sexp_of_t : ('a -> Sexplib0.Sexp.t) -> 'a t -> Sexplib0.Sexp.tval set :
'a t ->
Base.int ->
'a Heap_block.t Base.option ->
Base.unit @@ portableval set_exn : 'a t -> Base.int -> 'a Base.option -> Base.unit @@ portableset_exn raises an exception if given Some x with x not being a heap block. This is in addition to raising exceptions on bounds violation as set does.
val get : 'a t -> Base.int -> 'a Heap_block.t Base.option @@ portableval blit :
src:'a t ->
src_pos:Base.int ->
dst:'a t ->
dst_pos:Base.int ->
len:Base.int ->
Base.unit @@ portableblit is generally preferred over get followed by set because, unlike get, it doesn't have to make the value strongly-referenced. Making a value strongly-referenced, even temporarily, may result in delaying its garbage collection by a whole GC cycle.