package ocaml-base-compiler
Install
dune-project
Dependency
Authors
Maintainers
Sources
sha256=b53ed3d487b83fd49bc181bded066ae8e6fb592cf40514261d27d36050d5db85
md5=723b6bfe8cf5abcbccc6911143f71055
doc/stdlib/Stdlib/Obj/index.html
Module Stdlib.Obj
Operations on internal representations of values.
Not for the casual user.
val repr : 'a -> tval obj : t -> 'aval is_block : t -> boolval is_int : t -> boolval tag : t -> intval size : t -> intval reachable_words : t -> intComputes the total size (in words, including the headers) of all heap blocks accessible from the argument. Statically allocated blocks are excluded.
@Since 4.04
When using flambda:
set_field MUST NOT be called on immutable blocks. (Blocks allocated in C stubs, or with new_block below, are always considered mutable.)
The same goes for set_double_field and set_tag. However, for set_tag, in the case of immutable blocks where the middle-end optimizers never see code that discriminates on their tag (for example records), the operation should be safe. Such uses are nonetheless discouraged.
For experts only: set_field et al can be made safe by first wrapping the block in Sys.opaque_identity, so any information about its contents will not be propagated.
val set_tag : t -> int -> unitval double_field : t -> int -> floatval set_double_field : t -> int -> float -> unitval new_block : int -> int -> tval truncate : t -> int -> unitmodule Extension_constructor : sig ... endThe following two functions are deprecated. Use module Marshal instead.
val marshal : t -> bytesval unmarshal : bytes -> int -> t * intmodule Ephemeron : sig ... endEphemeron with arbitrary arity and untyped