Module Import0.Obj
Operations on internal representations of values.
Not for the casual user.
val is_block : t -> bool
val 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
val field : t -> int -> tval set_field : t -> int -> t -> unitWhen using flambda:
set_fieldMUST NOT be called on immutable blocks. (Blocks allocated in C stubs, or withnew_blockbelow, are always considered mutable.)The same goes for
set_double_fieldandset_tag. However, forset_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_fieldet al can be made safe by first wrapping the block inSys.opaque_identity, so any information about its contents will not be propagated.
val set_tag : t -> int -> unit
val new_block : int -> int -> tval dup : t -> tval truncate : t -> int -> unitval add_offset : t -> Int32.t -> tval with_tag : int -> t -> t
val first_non_constant_constructor_tag : intval last_non_constant_constructor_tag : intval lazy_tag : intval closure_tag : intval object_tag : intval infix_tag : intval forward_tag : intval no_scan_tag : intval abstract_tag : intval string_tag : intval double_tag : intval double_array_tag : intval custom_tag : intval final_tag : intval int_tag : intval out_of_heap_tag : intval unaligned_tag : int
module Extension_constructor : sig ... endval extension_constructor : 'a -> extension_constructorval extension_name : extension_constructor -> stringval extension_id : extension_constructor -> int
module Ephemeron : sig ... end