Module Stdlib.ObjSource
Operations on internal representations of values.
Not for the casual user.
Computes the total size (in words, including the headers) of all heap blocks accessible from the argument. Statically allocated blocks are included.
For each element of the array, computes the total size (as defined above by reachable_words) of all heap blocks accessible from the argument but excluding all blocks accessible from any other arguments.
Also returns a single number denoting the total memory reachable from at least two of the roots. We make no attempt to classify which two (or more) roots are responsible for this memory.
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.
dup t returns a shallow copy of t. However if t is immutable then it might be returned unchanged.
Blocks with a nominally scannable tag can still have a suffix of unscanned objects; such a block is "mixed". This contrasts with "uniform" blocks which are either all-scanned or all-unscanned.