Module Stdlib.Obj
Operations on internal representations of values.
Not for the casual user.
ocaml
type treasonml
type t;ocaml
type raw_data = nativeintreasonml
type raw_data = nativeint;ocaml
val repr : 'a -> treasonml
let repr: 'a => t;ocaml
val obj : t -> 'areasonml
let obj: t => 'a;ocaml
val magic : 'a -> 'breasonml
let magic: 'a => 'b;ocaml
val is_block : t -> boolreasonml
let is_block: t => bool;ocaml
val is_int : t -> boolreasonml
let is_int: t => bool;ocaml
val tag : t -> intreasonml
let tag: t => int;ocaml
val size : t -> intreasonml
let size: t => int;ocaml
val reachable_words : t -> intreasonml
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.
since 4.04
ocaml
val field : t -> int -> treasonml
let field: t => int => t;ocaml
val set_field : t -> int -> t -> unitreasonml
let set_field: t => int => t => unit;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.
ocaml
val double_field : t -> int -> floatreasonml
let double_field: t => int => float;ocaml
val set_double_field : t -> int -> float -> unitreasonml
let set_double_field: t => int => float => unit;ocaml
val raw_field : t -> int -> raw_datareasonml
let raw_field: t => int => raw_data;ocaml
val set_raw_field : t -> int -> raw_data -> unitreasonml
let set_raw_field: t => int => raw_data => unit;ocaml
val new_block : int -> int -> treasonml
let new_block: int => int => t;ocaml
val dup : t -> treasonml
let dup: t => t;ocaml
val add_offset : t -> Int32.t -> treasonml
let add_offset: t => Int32.t => t;ocaml
val with_tag : int -> t -> treasonml
let with_tag: int => t => t;ocaml
val first_non_constant_constructor_tag : intreasonml
let first_non_constant_constructor_tag: int;ocaml
val last_non_constant_constructor_tag : intreasonml
let last_non_constant_constructor_tag: int;ocaml
val forcing_tag : intreasonml
let forcing_tag: int;ocaml
val cont_tag : intreasonml
let cont_tag: int;ocaml
val lazy_tag : intreasonml
let lazy_tag: int;ocaml
val closure_tag : intreasonml
let closure_tag: int;ocaml
val object_tag : intreasonml
let object_tag: int;ocaml
val infix_tag : intreasonml
let infix_tag: int;ocaml
val forward_tag : intreasonml
let forward_tag: int;ocaml
val no_scan_tag : intreasonml
let no_scan_tag: int;ocaml
val abstract_tag : intreasonml
let abstract_tag: int;ocaml
val string_tag : intreasonml
let string_tag: int;ocaml
val double_tag : intreasonml
let double_tag: int;ocaml
val double_array_tag : intreasonml
let double_array_tag: int;ocaml
val custom_tag : intreasonml
let custom_tag: int;ocaml
val int_tag : intreasonml
let int_tag: int;ocaml
val out_of_heap_tag : intreasonml
let out_of_heap_tag: int;ocaml
val unaligned_tag : intreasonml
let unaligned_tag: int;ocaml
module Extension_constructor : sig ... endreasonml
module Extension_constructor: { ... };ocaml
module Ephemeron : sig ... endreasonml
module Ephemeron: { ... };Ephemeron with arbitrary arity and untyped