Stdlib.Obj
Operations on internal representations of values.
Not for the casual user.
let repr: 'a => t;
let obj: t => 'a;
let is_block: t => bool;
let is_int: t => bool;
let tag: t => int;
let size: t => int;
let reachable_words: t => int;
Computes the total size (in words, including the headers) of all heap blocks accessible from the argument. Statically allocated blocks are included.
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
.
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.
let double_field: t => int => float;
let set_double_field: t => int => float => unit;
let new_block: int => int => t;
module Closure: { ... };
module Extension_constructor: { ... };
module Ephemeron: { ... };
Ephemeron with arbitrary arity and untyped