man-pages/man3/Obj.3o.html
2021-03-31 01:06:50 +01:00

472 lines
4.5 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML><HEAD><TITLE>Man page of Obj</TITLE>
</HEAD><BODY>
<H1>Obj</H1>
Section: OCaml library (3o)<BR>Updated: 2020-01-30<BR><A HREF="#index">Index</A>
<A HREF="/cgi-bin/man/man2html">Return to Main Contents</A><HR>
<A NAME="lbAB">&nbsp;</A>
<H2>NAME</H2>
Obj - Operations on internal representations of values.
<A NAME="lbAC">&nbsp;</A>
<H2>Module</H2>
Module Obj
<A NAME="lbAD">&nbsp;</A>
<H2>Documentation</H2>
<P>
Module
<B>Obj</B>
<BR>&nbsp;:&nbsp;
<B>sig end</B>
<P>
<P>
Operations on internal representations of values.
<P>
Not for the casual user.
<P>
<P>
<P>
<P>
<P>
<I>type t </I>
<P>
<P>
<P>
<P>
<P>
<I>val repr </I>
:
<B>'a -&gt; t</B>
<P>
<P>
<P>
<P>
<I>val obj </I>
:
<B>t -&gt; 'a</B>
<P>
<P>
<P>
<P>
<I>val magic </I>
:
<B>'a -&gt; 'b</B>
<P>
<P>
<P>
<P>
<I>val is_block </I>
:
<B>t -&gt; bool</B>
<P>
<P>
<P>
<P>
<I>val is_int </I>
:
<B>t -&gt; bool</B>
<P>
<P>
<P>
<P>
<I>val tag </I>
:
<B>t -&gt; int</B>
<P>
<P>
<P>
<P>
<I>val size </I>
:
<B>t -&gt; int</B>
<P>
<P>
<P>
<P>
<I>val reachable_words </I>
:
<B>t -&gt; int</B>
<P>
Computes the total size (in words, including the headers) of all
heap blocks accessible from the argument. Statically
allocated blocks are excluded.
<P>
@Since 4.04
<P>
<P>
<P>
<I>val field </I>
:
<B>t -&gt; int -&gt; t</B>
<P>
<P>
<P>
<P>
<I>val set_field </I>
:
<B>t -&gt; int -&gt; t -&gt; unit</B>
<P>
When using flambda:
<P>
<P>
<B>set_field</B>
MUST NOT be called on immutable blocks. (Blocks allocated
in C stubs, or with
<B>new_block</B>
below, are always considered mutable.)
<P>
The same goes for
<B>set_double_field</B>
and
<B>set_tag</B>
. However, for
<B>set_tag</B>
, 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.
<P>
For experts only:
<B>set_field</B>
et al can be made safe by first wrapping the block in
<B>Sys.opaque_identity</B>
, so any information about its contents will not
be propagated.
<P>
<P>
<P>
<I>val set_tag </I>
:
<B>t -&gt; int -&gt; unit</B>
<P>
<P>
<P>
<P>
<I>val double_field </I>
:
<B>t -&gt; int -&gt; float</B>
<P>
<P>
<P>
<P>
<I>val set_double_field </I>
:
<B>t -&gt; int -&gt; float -&gt; unit</B>
<P>
<P>
<P>
<P>
<I>val new_block </I>
:
<B>int -&gt; int -&gt; t</B>
<P>
<P>
<P>
<P>
<I>val dup </I>
:
<B>t -&gt; t</B>
<P>
<P>
<P>
<P>
<I>val truncate </I>
:
<B>t -&gt; int -&gt; unit</B>
<P>
<P>
<P>
<P>
<I>val add_offset </I>
:
<B>t -&gt; Int32.t -&gt; t</B>
<P>
<P>
<P>
<P>
<I>val first_non_constant_constructor_tag </I>
:
<B>int</B>
<P>
<P>
<P>
<P>
<I>val last_non_constant_constructor_tag </I>
:
<B>int</B>
<P>
<P>
<P>
<P>
<I>val lazy_tag </I>
:
<B>int</B>
<P>
<P>
<P>
<P>
<I>val closure_tag </I>
:
<B>int</B>
<P>
<P>
<P>
<P>
<I>val object_tag </I>
:
<B>int</B>
<P>
<P>
<P>
<P>
<I>val infix_tag </I>
:
<B>int</B>
<P>
<P>
<P>
<P>
<I>val forward_tag </I>
:
<B>int</B>
<P>
<P>
<P>
<P>
<I>val no_scan_tag </I>
:
<B>int</B>
<P>
<P>
<P>
<P>
<I>val abstract_tag </I>
:
<B>int</B>
<P>
<P>
<P>
<P>
<I>val string_tag </I>
:
<B>int</B>
<P>
<P>
<P>
<P>
<I>val double_tag </I>
:
<B>int</B>
<P>
<P>
<P>
<P>
<I>val double_array_tag </I>
:
<B>int</B>
<P>
<P>
<P>
<P>
<I>val custom_tag </I>
:
<B>int</B>
<P>
<P>
<P>
<P>
<I>val final_tag </I>
:
<B>int</B>
<P>
<P>
<P>
<P>
<I>val int_tag </I>
:
<B>int</B>
<P>
<P>
<P>
<P>
<I>val out_of_heap_tag </I>
:
<B>int</B>
<P>
<P>
<P>
<P>
<I>val unaligned_tag </I>
:
<B>int</B>
<P>
<P>
<P>
<I>module Extension_constructor : </I>
<B>sig end</B>
<P>
<P>
<P>
<P>
<P>
<I>val extension_constructor </I>
:
<B>'a -&gt; extension_constructor</B>
<P>
<P>
<P>
<P>
<I>val extension_name </I>
:
<B>extension_constructor -&gt; string</B>
<P>
<P>
<P>
<P>
<I>val extension_id </I>
:
<B>extension_constructor -&gt; int</B>
<P>
<P>
<P>
<P>
<P>
The following two functions are deprecated. Use module
<B>Marshal</B>
instead.
<P>
<P>
<I>val marshal </I>
:
<B>t -&gt; bytes</B>
<P>
<P>
<P>
<P>
<I>val unmarshal </I>
:
<B>bytes -&gt; int -&gt; t * int</B>
<P>
<P>
<P>
<I>module Ephemeron : </I>
<B>sig end</B>
<P>
<P>
<P>
<P>
<P>
<HR>
<A NAME="index">&nbsp;</A><H2>Index</H2>
<DL>
<DT id="1"><A HREF="#lbAB">NAME</A><DD>
<DT id="2"><A HREF="#lbAC">Module</A><DD>
<DT id="3"><A HREF="#lbAD">Documentation</A><DD>
</DL>
<HR>
This document was created by
<A HREF="/cgi-bin/man/man2html">man2html</A>,
using the manual pages.<BR>
Time: 00:05:49 GMT, March 31, 2021
</BODY>
</HTML>