package core_kernel
- Overview
- No Docs
You can search for identifiers within the package.
in-package search v0.2.0
Install
dune-project
Dependency
Authors
Maintainers
Sources
sha256=66f5353964d35a994ec7fdc88fe60ae5d497ac89a8042786f3e37d9e2202ce4b
md5=ede2f6d22eaa8320f88bac67d41b5cff
doc/core_kernel.weak_array/Weak_array/index.html
Module Weak_array
Module 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 -> Ppx_sexp_conv_lib.Sexp.t) ->
'a t ->
Ppx_sexp_conv_lib.Sexp.tval create : len:int -> _ tval length : _ t -> intval set : 'a t -> int -> 'a Core_kernel.Heap_block.t option -> unitval set_exn : 'a t -> int -> 'a option -> unitset_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 -> int -> 'a Core_kernel.Heap_block.t optionval is_some : _ t -> int -> boolval is_none : _ t -> int -> boolval iter : 'a t -> f:('a -> unit) -> unitval iteri : 'a t -> f:(int -> 'a -> unit) -> unitWarning! blit often takes time linear in the size of the arrays, not in the size of the range being copied. This issue is being tracked in https://github.com/ocaml/ocaml/issues/9258.
Other than that, blit 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.