coffi/docs/coffi.mem.html
2024-11-22 10:07:45 -05:00

121 lines
No EOL
50 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!DOCTYPE html PUBLIC ""
"">
<html><head><meta charset="UTF-8" /><title>coffi.mem documentation</title><link rel="stylesheet" type="text/css" href="css/default.css" /><link rel="stylesheet" type="text/css" href="css/highlight.css" /><script type="text/javascript" src="js/highlight.min.js"></script><script type="text/javascript" src="js/jquery.min.js"></script><script type="text/javascript" src="js/page_effects.js"></script><script>hljs.initHighlightingOnLoad();</script></head><body><div id="header"><h2>Generated by <a href="https://github.com/weavejester/codox">Codox</a></h2><h1><a href="index.html"><span class="project-title"><span class="project-name">coffi</span> <span class="project-version">v1.0.486</span></span></a></h1></div><div class="sidebar primary"><h3 class="no-link"><span class="inner">Project</span></h3><ul class="index-link"><li class="depth-1 "><a href="index.html"><div class="inner">Index</div></a></li></ul><h3 class="no-link"><span class="inner">Topics</span></h3><ul><li class="depth-1 "><a href="01-Getting-Started.html"><div class="inner"><span>Getting Started</span></div></a></li><li class="depth-1 "><a href="02-Memory-Management.html"><div class="inner"><span>Memory Management</span></div></a></li><li class="depth-1 "><a href="03-Builtin-Types.html"><div class="inner"><span>Built-in Types **WIP**</span></div></a></li><li class="depth-1 "><a href="04-Custom-Types.html"><div class="inner"><span>Custom Types</span></div></a></li><li class="depth-1 "><a href="05-Low-Level-Wrappers.html"><div class="inner"><span>Low-Level Wrappers</span></div></a></li><li class="depth-1 "><a href="50-Data-Model.html"><div class="inner"><span>Data Model</span></div></a></li><li class="depth-1 "><a href="99-Benchmarks.html"><div class="inner"><span>Benchmarks **OUTDATED**</span></div></a></li></ul><h3 class="no-link"><span class="inner">Namespaces</span></h3><ul><li class="depth-1"><div class="no-link"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>coffi</span></div></div></li><li class="depth-2 branch"><a href="coffi.ffi.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>ffi</span></div></a></li><li class="depth-2 branch"><a href="coffi.layout.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>layout</span></div></a></li><li class="depth-2 current"><a href="coffi.mem.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>mem</span></div></a></li></ul></div><div class="sidebar secondary"><h3><a href="#top"><span class="inner">Public Vars</span></a></h3><ul><li class="depth-1"><a href="coffi.mem.html#var-address-of"><div class="inner"><span>address-of</span></div></a></li><li class="depth-1"><a href="coffi.mem.html#var-address.3F"><div class="inner"><span>address?</span></div></a></li><li class="depth-1"><a href="coffi.mem.html#var-align-of"><div class="inner"><span>align-of</span></div></a></li><li class="depth-1"><a href="coffi.mem.html#var-alloc"><div class="inner"><span>alloc</span></div></a></li><li class="depth-1"><a href="coffi.mem.html#var-alloc-instance"><div class="inner"><span>alloc-instance</span></div></a></li><li class="depth-1"><a href="coffi.mem.html#var-alloc-with"><div class="inner"><span>alloc-with</span></div></a></li><li class="depth-1"><a href="coffi.mem.html#var-arena-allocator"><div class="inner"><span>arena-allocator</span></div></a></li><li class="depth-1"><a href="coffi.mem.html#var-as-segment"><div class="inner"><span>as-segment</span></div></a></li><li class="depth-1"><a href="coffi.mem.html#var-auto-arena"><div class="inner"><span>auto-arena</span></div></a></li><li class="depth-1"><a href="coffi.mem.html#var-big-endian"><div class="inner"><span>big-endian</span></div></a></li><li class="depth-1"><a href="coffi.mem.html#var-byte-layout"><div class="inner"><span>byte-layout</span></div></a></li><li class="depth-1"><a href="coffi.mem.html#var-c-layout"><div class="inner"><span>c-layout</span></div></a></li><li class="depth-1"><a href="coffi.mem.html#var-char-layout"><div class="inner"><span>char-layout</span></div></a></li><li class="depth-1"><a href="coffi.mem.html#var-clone-segment"><div class="inner"><span>clone-segment</span></div></a></li><li class="depth-1"><a href="coffi.mem.html#var-confined-arena"><div class="inner"><span>confined-arena</span></div></a></li><li class="depth-1"><a href="coffi.mem.html#var-copy-segment"><div class="inner"><span>copy-segment</span></div></a></li><li class="depth-1"><a href="coffi.mem.html#var-defalias"><div class="inner"><span>defalias</span></div></a></li><li class="depth-1"><a href="coffi.mem.html#var-deserialize"><div class="inner"><span>deserialize</span></div></a></li><li class="depth-1"><a href="coffi.mem.html#var-deserialize*"><div class="inner"><span>deserialize*</span></div></a></li><li class="depth-1"><a href="coffi.mem.html#var-deserialize-from"><div class="inner"><span>deserialize-from</span></div></a></li><li class="depth-1"><a href="coffi.mem.html#var-double-alignment"><div class="inner"><span>double-alignment</span></div></a></li><li class="depth-1"><a href="coffi.mem.html#var-double-layout"><div class="inner"><span>double-layout</span></div></a></li><li class="depth-1"><a href="coffi.mem.html#var-double-size"><div class="inner"><span>double-size</span></div></a></li><li class="depth-1"><a href="coffi.mem.html#var-float-alignment"><div class="inner"><span>float-alignment</span></div></a></li><li class="depth-1"><a href="coffi.mem.html#var-float-layout"><div class="inner"><span>float-layout</span></div></a></li><li class="depth-1"><a href="coffi.mem.html#var-float-size"><div class="inner"><span>float-size</span></div></a></li><li class="depth-1"><a href="coffi.mem.html#var-global-arena"><div class="inner"><span>global-arena</span></div></a></li><li class="depth-1"><a href="coffi.mem.html#var-int-alignment"><div class="inner"><span>int-alignment</span></div></a></li><li class="depth-1"><a href="coffi.mem.html#var-int-layout"><div class="inner"><span>int-layout</span></div></a></li><li class="depth-1"><a href="coffi.mem.html#var-int-size"><div class="inner"><span>int-size</span></div></a></li><li class="depth-1"><a href="coffi.mem.html#var-java-layout"><div class="inner"><span>java-layout</span></div></a></li><li class="depth-1"><a href="coffi.mem.html#var-java-prim-layout"><div class="inner"><span>java-prim-layout</span></div></a></li><li class="depth-1"><a href="coffi.mem.html#var-little-endian"><div class="inner"><span>little-endian</span></div></a></li><li class="depth-1"><a href="coffi.mem.html#var-long-alignment"><div class="inner"><span>long-alignment</span></div></a></li><li class="depth-1"><a href="coffi.mem.html#var-long-layout"><div class="inner"><span>long-layout</span></div></a></li><li class="depth-1"><a href="coffi.mem.html#var-long-size"><div class="inner"><span>long-size</span></div></a></li><li class="depth-1"><a href="coffi.mem.html#var-native-endian"><div class="inner"><span>native-endian</span></div></a></li><li class="depth-1"><a href="coffi.mem.html#var-null"><div class="inner"><span>null</span></div></a></li><li class="depth-1"><a href="coffi.mem.html#var-null.3F"><div class="inner"><span>null?</span></div></a></li><li class="depth-1"><a href="coffi.mem.html#var-pointer-alignment"><div class="inner"><span>pointer-alignment</span></div></a></li><li class="depth-1"><a href="coffi.mem.html#var-pointer-layout"><div class="inner"><span>pointer-layout</span></div></a></li><li class="depth-1"><a href="coffi.mem.html#var-pointer-size"><div class="inner"><span>pointer-size</span></div></a></li><li class="depth-1"><a href="coffi.mem.html#var-primitive-type"><div class="inner"><span>primitive-type</span></div></a></li><li class="depth-1"><a href="coffi.mem.html#var-primitive-types"><div class="inner"><span>primitive-types</span></div></a></li><li class="depth-1"><a href="coffi.mem.html#var-primitive.3F"><div class="inner"><span>primitive?</span></div></a></li><li class="depth-1"><a href="coffi.mem.html#var-read-address"><div class="inner"><span>read-address</span></div></a></li><li class="depth-1"><a href="coffi.mem.html#var-read-byte"><div class="inner"><span>read-byte</span></div></a></li><li class="depth-1"><a href="coffi.mem.html#var-read-char"><div class="inner"><span>read-char</span></div></a></li><li class="depth-1"><a href="coffi.mem.html#var-read-double"><div class="inner"><span>read-double</span></div></a></li><li class="depth-1"><a href="coffi.mem.html#var-read-float"><div class="inner"><span>read-float</span></div></a></li><li class="depth-1"><a href="coffi.mem.html#var-read-int"><div class="inner"><span>read-int</span></div></a></li><li class="depth-1"><a href="coffi.mem.html#var-read-long"><div class="inner"><span>read-long</span></div></a></li><li class="depth-1"><a href="coffi.mem.html#var-read-short"><div class="inner"><span>read-short</span></div></a></li><li class="depth-1"><a href="coffi.mem.html#var-reinterpret"><div class="inner"><span>reinterpret</span></div></a></li><li class="depth-1"><a href="coffi.mem.html#var-seq-of"><div class="inner"><span>seq-of</span></div></a></li><li class="depth-1"><a href="coffi.mem.html#var-serialize"><div class="inner"><span>serialize</span></div></a></li><li class="depth-1"><a href="coffi.mem.html#var-serialize*"><div class="inner"><span>serialize*</span></div></a></li><li class="depth-1"><a href="coffi.mem.html#var-serialize-into"><div class="inner"><span>serialize-into</span></div></a></li><li class="depth-1"><a href="coffi.mem.html#var-shared-arena"><div class="inner"><span>shared-arena</span></div></a></li><li class="depth-1"><a href="coffi.mem.html#var-short-alignment"><div class="inner"><span>short-alignment</span></div></a></li><li class="depth-1"><a href="coffi.mem.html#var-short-layout"><div class="inner"><span>short-layout</span></div></a></li><li class="depth-1"><a href="coffi.mem.html#var-short-size"><div class="inner"><span>short-size</span></div></a></li><li class="depth-1"><a href="coffi.mem.html#var-size-of"><div class="inner"><span>size-of</span></div></a></li><li class="depth-1"><a href="coffi.mem.html#var-slice"><div class="inner"><span>slice</span></div></a></li><li class="depth-1"><a href="coffi.mem.html#var-slice-segments"><div class="inner"><span>slice-segments</span></div></a></li><li class="depth-1"><a href="coffi.mem.html#var-write-address"><div class="inner"><span>write-address</span></div></a></li><li class="depth-1"><a href="coffi.mem.html#var-write-byte"><div class="inner"><span>write-byte</span></div></a></li><li class="depth-1"><a href="coffi.mem.html#var-write-char"><div class="inner"><span>write-char</span></div></a></li><li class="depth-1"><a href="coffi.mem.html#var-write-double"><div class="inner"><span>write-double</span></div></a></li><li class="depth-1"><a href="coffi.mem.html#var-write-float"><div class="inner"><span>write-float</span></div></a></li><li class="depth-1"><a href="coffi.mem.html#var-write-int"><div class="inner"><span>write-int</span></div></a></li><li class="depth-1"><a href="coffi.mem.html#var-write-long"><div class="inner"><span>write-long</span></div></a></li><li class="depth-1"><a href="coffi.mem.html#var-write-short"><div class="inner"><span>write-short</span></div></a></li></ul></div><div class="namespace-docs" id="content"><h1 class="anchor" id="top">coffi.mem</h1><div class="doc"><div class="markdown"><p>Functions for managing native allocations, memory arenas, and (de)serialization.</p>
<p>For any new type to be implemented, three multimethods must be overriden, but which three depends on the native representation of the type.</p>
<p>If the native representation of the type is a primitive (whether or not other data beyond the primitive is associated with it, as e.g. a pointer), then <a href="coffi.mem.html#var-primitive-type">primitive-type</a> must be overriden to return which primitive type it is serialized as, then <a href="coffi.mem.html#var-serialize*">serialize*</a> and <a href="coffi.mem.html#var-deserialize*">deserialize*</a> should be overriden.</p>
<p>If the native representation of the type is a composite type, like a union, struct, or array, then <a href="coffi.mem.html#var-c-layout">c-layout</a> must be overriden to return the native layout of the type, and <a href="coffi.mem.html#var-serialize-into">serialize-into</a> and <a href="coffi.mem.html#var-deserialize-from">deserialize-from</a> should be overriden to allow marshaling values of the type into and out of memory segments.</p>
</div></div><div class="public anchor" id="var-address-of"><h3>address-of</h3><div class="usage"><code>(address-of addressable)</code></div><div class="doc"><div class="markdown"><p>Gets the address of a given segment as a number.</p>
</div></div><div class="src-link"><a href="https://github.com/IGJoshua/coffi/blob/8fd68fd2ac43bef595250e7fdf324e03287883ba/src/clj/coffi/mem.clj#L108">view source</a></div></div><div class="public anchor" id="var-address.3F"><h3>address?</h3><div class="usage"><code>(address? addr)</code></div><div class="doc"><div class="markdown"><p>Checks if an object is a memory address.</p>
<p><code>nil</code> is considered an address.</p>
</div></div><div class="src-link"><a href="https://github.com/IGJoshua/coffi/blob/8fd68fd2ac43bef595250e7fdf324e03287883ba/src/clj/coffi/mem.clj#L126">view source</a></div></div><div class="public anchor" id="var-align-of"><h3>align-of</h3><div class="usage"><code>(align-of type)</code></div><div class="doc"><div class="markdown"><p>The alignment in bytes of the given <code>type</code>.</p>
</div></div><div class="src-link"><a href="https://github.com/IGJoshua/coffi/blob/8fd68fd2ac43bef595250e7fdf324e03287883ba/src/clj/coffi/mem.clj#L813">view source</a></div></div><div class="public anchor" id="var-alloc"><h3>alloc</h3><div class="usage"><code>(alloc size)</code><code>(alloc size arena)</code><code>(alloc size alignment arena)</code></div><div class="doc"><div class="markdown"><p>Allocates <code>size</code> bytes.</p>
<p>If an <code>arena</code> is provided, the allocation will be reclaimed when it is closed.</p>
</div></div><div class="src-link"><a href="https://github.com/IGJoshua/coffi/blob/8fd68fd2ac43bef595250e7fdf324e03287883ba/src/clj/coffi/mem.clj#L93">view source</a></div></div><div class="public anchor" id="var-alloc-instance"><h3>alloc-instance</h3><div class="usage"><code>(alloc-instance type)</code><code>(alloc-instance type arena)</code></div><div class="doc"><div class="markdown"><p>Allocates a memory segment for the given <code>type</code>.</p>
</div></div><div class="src-link"><a href="https://github.com/IGJoshua/coffi/blob/8fd68fd2ac43bef595250e7fdf324e03287883ba/src/clj/coffi/mem.clj#L820">view source</a></div></div><div class="public anchor" id="var-alloc-with"><h3>alloc-with</h3><div class="usage"><code>(alloc-with allocator size)</code><code>(alloc-with allocator size alignment)</code></div><div class="doc"><div class="markdown"><p>Allocates <code>size</code> bytes using the <code>allocator</code>.</p>
</div></div><div class="src-link"><a href="https://github.com/IGJoshua/coffi/blob/8fd68fd2ac43bef595250e7fdf324e03287883ba/src/clj/coffi/mem.clj#L101">view source</a></div></div><div class="public anchor" id="var-arena-allocator"><h3>arena-allocator</h3><div class="usage"><code>(arena-allocator arena)</code></div><div class="doc"><div class="markdown"><p>Constructs a <a href="null">SegmentAllocator</a> from the given <a href="null">Arena</a>.</p>
<p>This is primarily used when working with unwrapped downcall functions. When a downcall function returns a non-primitive type, it must be provided with an allocator.</p>
</div></div><div class="src-link"><a href="https://github.com/IGJoshua/coffi/blob/8fd68fd2ac43bef595250e7fdf324e03287883ba/src/clj/coffi/mem.clj#L82">view source</a></div></div><div class="public anchor" id="var-as-segment"><h3>as-segment</h3><div class="usage"><code>(as-segment address)</code><code>(as-segment address size)</code><code>(as-segment address size arena)</code><code>(as-segment address size arena cleanup)</code></div><div class="doc"><div class="markdown"><p>Dereferences an <code>address</code> into a memory segment associated with the <code>arena</code> (default global).</p>
</div></div><div class="src-link"><a href="https://github.com/IGJoshua/coffi/blob/8fd68fd2ac43bef595250e7fdf324e03287883ba/src/clj/coffi/mem.clj#L158">view source</a></div></div><div class="public anchor" id="var-auto-arena"><h3>auto-arena</h3><div class="usage"><code>(auto-arena)</code></div><div class="doc"><div class="markdown"><p>Constructs a new memory arena that is managed by the garbage collector.</p>
<p>The arena may be shared across threads, and all resources created with it will be cleaned up at the same time, when all references have been collected.</p>
<p>This type of arena cannot be closed, and therefore should not be created in a <a href="null">with-open</a> clause.</p>
</div></div><div class="src-link"><a href="https://github.com/IGJoshua/coffi/blob/8fd68fd2ac43bef595250e7fdf324e03287883ba/src/clj/coffi/mem.clj#L61">view source</a></div></div><div class="public anchor" id="var-big-endian"><h3>big-endian</h3><div class="usage"></div><div class="doc"><div class="markdown"><p>The big-endian <a href="null">ByteOrder</a>.</p>
<p>See <a href="coffi.mem.html#var-little-endian">little-endian</a>, <a href="coffi.mem.html#var-native-endian">native-endian</a>.</p>
</div></div><div class="src-link"><a href="https://github.com/IGJoshua/coffi/blob/8fd68fd2ac43bef595250e7fdf324e03287883ba/src/clj/coffi/mem.clj#L189">view source</a></div></div><div class="public anchor" id="var-byte-layout"><h3>byte-layout</h3><div class="usage"></div><div class="doc"><div class="markdown"><p>The <a href="null">MemoryLayout</a> for a byte in <a href="coffi.mem.html#var-native-endian">native-endian</a> <a href="null">ByteOrder</a>.</p>
</div></div><div class="src-link"><a href="https://github.com/IGJoshua/coffi/blob/8fd68fd2ac43bef595250e7fdf324e03287883ba/src/clj/coffi/mem.clj#L207">view source</a></div></div><div class="public anchor" id="var-c-layout"><h3>c-layout</h3><h4 class="type">multimethod</h4><div class="usage"></div><div class="doc"><div class="markdown"><p>Gets the layout object for a given <code>type</code>.</p>
<p>If a type is primitive it will return the appropriate primitive layout (see <a href="null">c-prim-layout</a>).</p>
<p>Otherwise, it should return a <a href="null">GroupLayout</a> for the given type.</p>
</div></div><div class="src-link"><a href="https://github.com/IGJoshua/coffi/blob/8fd68fd2ac43bef595250e7fdf324e03287883ba/src/clj/coffi/mem.clj#L731">view source</a></div></div><div class="public anchor" id="var-char-layout"><h3>char-layout</h3><div class="usage"></div><div class="doc"><div class="markdown"><p>The <a href="null">MemoryLayout</a> for a c-sized char in <a href="coffi.mem.html#var-native-endian">native-endian</a> <a href="null">ByteOrder</a>.</p>
</div></div><div class="src-link"><a href="https://github.com/IGJoshua/coffi/blob/8fd68fd2ac43bef595250e7fdf324e03287883ba/src/clj/coffi/mem.clj#L223">view source</a></div></div><div class="public anchor" id="var-clone-segment"><h3>clone-segment</h3><div class="usage"><code>(clone-segment segment)</code><code>(clone-segment segment arena)</code></div><div class="doc"><div class="markdown"><p>Clones the content of <code>segment</code> into a new segment of the same size.</p>
</div></div><div class="src-link"><a href="https://github.com/IGJoshua/coffi/blob/8fd68fd2ac43bef595250e7fdf324e03287883ba/src/clj/coffi/mem.clj#L176">view source</a></div></div><div class="public anchor" id="var-confined-arena"><h3>confined-arena</h3><div class="usage"><code>(confined-arena)</code></div><div class="doc"><div class="markdown"><p>Constructs a new arena for use only in this thread.</p>
<p>The memory allocated within this arena is cheap to allocate, like a native stack.</p>
<p>The memory allocated within this arena will be cleared once it is closed, so it is usually a good idea to create it in a <a href="null">with-open</a> clause.</p>
</div></div><div class="src-link"><a href="https://github.com/IGJoshua/coffi/blob/8fd68fd2ac43bef595250e7fdf324e03287883ba/src/clj/coffi/mem.clj#L42">view source</a></div></div><div class="public anchor" id="var-copy-segment"><h3>copy-segment</h3><div class="usage"><code>(copy-segment dest src)</code></div><div class="doc"><div class="markdown"><p>Copies the content to <code>dest</code> from <code>src</code>.</p>
<p>Returns <code>dest</code>.</p>
</div></div><div class="src-link"><a href="https://github.com/IGJoshua/coffi/blob/8fd68fd2ac43bef595250e7fdf324e03287883ba/src/clj/coffi/mem.clj#L169">view source</a></div></div><div class="public anchor" id="var-defalias"><h3>defalias</h3><h4 class="type">macro</h4><div class="usage"><code>(defalias new-type aliased-type)</code></div><div class="doc"><div class="markdown"><p>Defines a type alias from <code>new-type</code> to <code>aliased-type</code>.</p>
<p>This creates needed serialization and deserialization implementations for the aliased type.</p>
</div></div><div class="src-link"><a href="https://github.com/IGJoshua/coffi/blob/8fd68fd2ac43bef595250e7fdf324e03287883ba/src/clj/coffi/mem.clj#L1326">view source</a></div></div><div class="public anchor" id="var-deserialize"><h3>deserialize</h3><div class="usage"><code>(deserialize obj type)</code></div><div class="doc"><div class="markdown"><p>Deserializes an arbitrary type.</p>
<p>For types which have a primitive representation, this deserializes the primitive representation. For types which do not, this deserializes out of a segment.</p>
</div></div><div class="src-link"><a href="https://github.com/IGJoshua/coffi/blob/8fd68fd2ac43bef595250e7fdf324e03287883ba/src/clj/coffi/mem.clj#L1094">view source</a></div></div><div class="public anchor" id="var-deserialize*"><h3>deserialize*</h3><h4 class="type">multimethod</h4><div class="usage"></div><div class="doc"><div class="markdown"><p>Deserializes a primitive object into a Clojure data structure.</p>
<p>This is intended for use with types that are returned as a primitive but which need additional processing before they can be returned.</p>
</div></div><div class="src-link"><a href="https://github.com/IGJoshua/coffi/blob/8fd68fd2ac43bef595250e7fdf324e03287883ba/src/clj/coffi/mem.clj#L1035">view source</a></div></div><div class="public anchor" id="var-deserialize-from"><h3>deserialize-from</h3><h4 class="type">multimethod</h4><div class="usage"></div><div class="doc"><div class="markdown"><p>Deserializes the given segment into a Clojure data structure.</p>
<p>For types that serialize to primitives, a default implementation will deserialize the primitive before calling <a href="coffi.mem.html#var-deserialize*">deserialize*</a>.</p>
</div></div><div class="src-link"><a href="https://github.com/IGJoshua/coffi/blob/8fd68fd2ac43bef595250e7fdf324e03287883ba/src/clj/coffi/mem.clj#L972">view source</a></div></div><div class="public anchor" id="var-double-alignment"><h3>double-alignment</h3><div class="usage"></div><div class="doc"><div class="markdown"><p>The alignment in bytes of a c-sized double.</p>
</div></div><div class="src-link"><a href="https://github.com/IGJoshua/coffi/blob/8fd68fd2ac43bef595250e7fdf324e03287883ba/src/clj/coffi/mem.clj#L279">view source</a></div></div><div class="public anchor" id="var-double-layout"><h3>double-layout</h3><div class="usage"></div><div class="doc"><div class="markdown"><p>The <a href="null">MemoryLayout</a> for a c-sized double in <a href="coffi.mem.html#var-native-endian">native-endian</a> <a href="null">ByteOrder</a>.</p>
</div></div><div class="src-link"><a href="https://github.com/IGJoshua/coffi/blob/8fd68fd2ac43bef595250e7fdf324e03287883ba/src/clj/coffi/mem.clj#L231">view source</a></div></div><div class="public anchor" id="var-double-size"><h3>double-size</h3><div class="usage"></div><div class="doc"><div class="markdown"><p>The size in bytes of a c-sized double.</p>
</div></div><div class="src-link"><a href="https://github.com/IGJoshua/coffi/blob/8fd68fd2ac43bef595250e7fdf324e03287883ba/src/clj/coffi/mem.clj#L255">view source</a></div></div><div class="public anchor" id="var-float-alignment"><h3>float-alignment</h3><div class="usage"></div><div class="doc"><div class="markdown"><p>The alignment in bytes of a c-sized float.</p>
</div></div><div class="src-link"><a href="https://github.com/IGJoshua/coffi/blob/8fd68fd2ac43bef595250e7fdf324e03287883ba/src/clj/coffi/mem.clj#L275">view source</a></div></div><div class="public anchor" id="var-float-layout"><h3>float-layout</h3><div class="usage"></div><div class="doc"><div class="markdown"><p>The <a href="null">MemoryLayout</a> for a c-sized float in <a href="coffi.mem.html#var-native-endian">native-endian</a> <a href="null">ByteOrder</a>.</p>
</div></div><div class="src-link"><a href="https://github.com/IGJoshua/coffi/blob/8fd68fd2ac43bef595250e7fdf324e03287883ba/src/clj/coffi/mem.clj#L227">view source</a></div></div><div class="public anchor" id="var-float-size"><h3>float-size</h3><div class="usage"></div><div class="doc"><div class="markdown"><p>The size in bytes of a c-sized float.</p>
</div></div><div class="src-link"><a href="https://github.com/IGJoshua/coffi/blob/8fd68fd2ac43bef595250e7fdf324e03287883ba/src/clj/coffi/mem.clj#L251">view source</a></div></div><div class="public anchor" id="var-global-arena"><h3>global-arena</h3><div class="usage"><code>(global-arena)</code></div><div class="doc"><div class="markdown"><p>Constructs the global arena, which will never reclaim its resources.</p>
<p>This arena may be shared across threads, but is intended mainly in cases where memory is allocated with <a href="coffi.mem.html#var-alloc">alloc</a> but is either never freed or whose management is relinquished to a native library, such as when returned from a callback.</p>
</div></div><div class="src-link"><a href="https://github.com/IGJoshua/coffi/blob/8fd68fd2ac43bef595250e7fdf324e03287883ba/src/clj/coffi/mem.clj#L72">view source</a></div></div><div class="public anchor" id="var-int-alignment"><h3>int-alignment</h3><div class="usage"></div><div class="doc"><div class="markdown"><p>The alignment in bytes of a c-sized int.</p>
</div></div><div class="src-link"><a href="https://github.com/IGJoshua/coffi/blob/8fd68fd2ac43bef595250e7fdf324e03287883ba/src/clj/coffi/mem.clj#L267">view source</a></div></div><div class="public anchor" id="var-int-layout"><h3>int-layout</h3><div class="usage"></div><div class="doc"><div class="markdown"><p>The <a href="null">MemoryLayout</a> for a c-sized int in <a href="coffi.mem.html#var-native-endian">native-endian</a> <a href="null">ByteOrder</a>.</p>
</div></div><div class="src-link"><a href="https://github.com/IGJoshua/coffi/blob/8fd68fd2ac43bef595250e7fdf324e03287883ba/src/clj/coffi/mem.clj#L215">view source</a></div></div><div class="public anchor" id="var-int-size"><h3>int-size</h3><div class="usage"></div><div class="doc"><div class="markdown"><p>The size in bytes of a c-sized int.</p>
</div></div><div class="src-link"><a href="https://github.com/IGJoshua/coffi/blob/8fd68fd2ac43bef595250e7fdf324e03287883ba/src/clj/coffi/mem.clj#L243">view source</a></div></div><div class="public anchor" id="var-java-layout"><h3>java-layout</h3><div class="usage"><code>(java-layout type)</code></div><div class="doc"><div class="markdown"><p>Gets the Java class to an argument of this type for a method handle.</p>
<p>If a type serializes to a primitive it returns return a Java primitive type. Otherwise, it returns <a href="null">MemorySegment</a>.</p>
</div></div><div class="src-link"><a href="https://github.com/IGJoshua/coffi/blob/8fd68fd2ac43bef595250e7fdf324e03287883ba/src/clj/coffi/mem.clj#L798">view source</a></div></div><div class="public anchor" id="var-java-prim-layout"><h3>java-prim-layout</h3><div class="usage"></div><div class="doc"><div class="markdown"><p>Map of primitive type names to the Java types for a method handle.</p>
</div></div><div class="src-link"><a href="https://github.com/IGJoshua/coffi/blob/8fd68fd2ac43bef595250e7fdf324e03287883ba/src/clj/coffi/mem.clj#L786">view source</a></div></div><div class="public anchor" id="var-little-endian"><h3>little-endian</h3><div class="usage"></div><div class="doc"><div class="markdown"><p>The little-endian <a href="null">ByteOrder</a>.</p>
<p>See <a href="coffi.mem.html#var-big-endian">big-endian</a>, <a href="coffi.mem.html#var-native-endian">native-endian</a></p>
</div></div><div class="src-link"><a href="https://github.com/IGJoshua/coffi/blob/8fd68fd2ac43bef595250e7fdf324e03287883ba/src/clj/coffi/mem.clj#L195">view source</a></div></div><div class="public anchor" id="var-long-alignment"><h3>long-alignment</h3><div class="usage"></div><div class="doc"><div class="markdown"><p>The alignment in bytes of a c-sized long.</p>
</div></div><div class="src-link"><a href="https://github.com/IGJoshua/coffi/blob/8fd68fd2ac43bef595250e7fdf324e03287883ba/src/clj/coffi/mem.clj#L271">view source</a></div></div><div class="public anchor" id="var-long-layout"><h3>long-layout</h3><div class="usage"></div><div class="doc"><div class="markdown"><p>The <a href="null">MemoryLayout</a> for a c-sized long in <a href="coffi.mem.html#var-native-endian">native-endian</a> <a href="null">ByteOrder</a>.</p>
</div></div><div class="src-link"><a href="https://github.com/IGJoshua/coffi/blob/8fd68fd2ac43bef595250e7fdf324e03287883ba/src/clj/coffi/mem.clj#L219">view source</a></div></div><div class="public anchor" id="var-long-size"><h3>long-size</h3><div class="usage"></div><div class="doc"><div class="markdown"><p>The size in bytes of a c-sized long.</p>
</div></div><div class="src-link"><a href="https://github.com/IGJoshua/coffi/blob/8fd68fd2ac43bef595250e7fdf324e03287883ba/src/clj/coffi/mem.clj#L247">view source</a></div></div><div class="public anchor" id="var-native-endian"><h3>native-endian</h3><div class="usage"></div><div class="doc"><div class="markdown"><p>The <a href="null">ByteOrder</a> for the native endianness of the current hardware.</p>
<p>See <a href="coffi.mem.html#var-big-endian">big-endian</a>, <a href="coffi.mem.html#var-little-endian">little-endian</a>.</p>
</div></div><div class="src-link"><a href="https://github.com/IGJoshua/coffi/blob/8fd68fd2ac43bef595250e7fdf324e03287883ba/src/clj/coffi/mem.clj#L201">view source</a></div></div><div class="public anchor" id="var-null"><h3>null</h3><div class="usage"></div><div class="doc"><div class="markdown"><p>The NULL pointer object.</p>
<p>While this object is safe to pass to functions which serialize to a pointer, its generally encouraged to simply pass <code>nil</code>. This value primarily exists to make it easier to write custom types with a primitive pointer representation.</p>
</div></div><div class="src-link"><a href="https://github.com/IGJoshua/coffi/blob/8fd68fd2ac43bef595250e7fdf324e03287883ba/src/clj/coffi/mem.clj#L113">view source</a></div></div><div class="public anchor" id="var-null.3F"><h3>null?</h3><div class="usage"><code>(null? addr)</code></div><div class="doc"><div class="markdown"><p>Checks if a memory address is null.</p>
</div></div><div class="src-link"><a href="https://github.com/IGJoshua/coffi/blob/8fd68fd2ac43bef595250e7fdf324e03287883ba/src/clj/coffi/mem.clj#L121">view source</a></div></div><div class="public anchor" id="var-pointer-alignment"><h3>pointer-alignment</h3><div class="usage"></div><div class="doc"><div class="markdown"><p>The alignment in bytes of a c-sized pointer.</p>
</div></div><div class="src-link"><a href="https://github.com/IGJoshua/coffi/blob/8fd68fd2ac43bef595250e7fdf324e03287883ba/src/clj/coffi/mem.clj#L283">view source</a></div></div><div class="public anchor" id="var-pointer-layout"><h3>pointer-layout</h3><div class="usage"></div><div class="doc"><div class="markdown"><p>The <a href="null">MemoryLayout</a> for a native pointer in <a href="coffi.mem.html#var-native-endian">native-endian</a> <a href="null">ByteOrder</a>.</p>
</div></div><div class="src-link"><a href="https://github.com/IGJoshua/coffi/blob/8fd68fd2ac43bef595250e7fdf324e03287883ba/src/clj/coffi/mem.clj#L235">view source</a></div></div><div class="public anchor" id="var-pointer-size"><h3>pointer-size</h3><div class="usage"></div><div class="doc"><div class="markdown"><p>The size in bytes of a c-sized pointer.</p>
</div></div><div class="src-link"><a href="https://github.com/IGJoshua/coffi/blob/8fd68fd2ac43bef595250e7fdf324e03287883ba/src/clj/coffi/mem.clj#L259">view source</a></div></div><div class="public anchor" id="var-primitive-type"><h3>primitive-type</h3><h4 class="type">multimethod</h4><div class="usage"></div><div class="doc"><div class="markdown"><p>Gets the primitive type that is used to pass as an argument for the <code>type</code>.</p>
<p>This is for objects which are passed to native functions as primitive types, but which need additional logic to be performed during serialization and deserialization.</p>
<p>Implementations of this method should take into account that type arguments may not always be evaluated before passing to this function.</p>
<p>Returns nil for any type which does not have a primitive representation.</p>
</div></div><div class="src-link"><a href="https://github.com/IGJoshua/coffi/blob/8fd68fd2ac43bef595250e7fdf324e03287883ba/src/clj/coffi/mem.clj#L678">view source</a></div></div><div class="public anchor" id="var-primitive-types"><h3>primitive-types</h3><div class="usage"></div><div class="doc"><div class="markdown"><p>A set of all primitive types.</p>
</div></div><div class="src-link"><a href="https://github.com/IGJoshua/coffi/blob/8fd68fd2ac43bef595250e7fdf324e03287883ba/src/clj/coffi/mem.clj#L668">view source</a></div></div><div class="public anchor" id="var-primitive.3F"><h3>primitive?</h3><div class="usage"><code>(primitive? type)</code></div><div class="doc"><div class="markdown"><p>A predicate to determine if a given type is primitive.</p>
</div></div><div class="src-link"><a href="https://github.com/IGJoshua/coffi/blob/8fd68fd2ac43bef595250e7fdf324e03287883ba/src/clj/coffi/mem.clj#L673">view source</a></div></div><div class="public anchor" id="var-read-address"><h3>read-address</h3><div class="usage"><code>(read-address segment)</code><code>(read-address segment offset)</code></div><div class="doc"><div class="markdown"><p>Reads an address from the <code>segment</code>, at an optional <code>offset</code>, wrapped in a <a href="null">MemorySegment</a>.</p>
</div></div><div class="src-link"><a href="https://github.com/IGJoshua/coffi/blob/8fd68fd2ac43bef595250e7fdf324e03287883ba/src/clj/coffi/mem.clj#L444">view source</a></div></div><div class="public anchor" id="var-read-byte"><h3>read-byte</h3><div class="usage"><code>(read-byte segment)</code><code>(read-byte segment offset)</code></div><div class="doc"><div class="markdown"><p>Reads a <a href="null">byte</a> from the <code>segment</code>, at an optional <code>offset</code>.</p>
</div></div><div class="src-link"><a href="https://github.com/IGJoshua/coffi/blob/8fd68fd2ac43bef595250e7fdf324e03287883ba/src/clj/coffi/mem.clj#L287">view source</a></div></div><div class="public anchor" id="var-read-char"><h3>read-char</h3><div class="usage"><code>(read-char segment)</code><code>(read-char segment offset)</code></div><div class="doc"><div class="markdown"><p>Reads a <a href="null">char</a> from the <code>segment</code>, at an optional <code>offset</code>.</p>
</div></div><div class="src-link"><a href="https://github.com/IGJoshua/coffi/blob/8fd68fd2ac43bef595250e7fdf324e03287883ba/src/clj/coffi/mem.clj#L378">view source</a></div></div><div class="public anchor" id="var-read-double"><h3>read-double</h3><div class="usage"><code>(read-double segment)</code><code>(read-double segment offset)</code><code>(read-double segment offset byte-order)</code></div><div class="doc"><div class="markdown"><p>Reads a <a href="null">double</a> from the <code>segment</code>, at an optional <code>offset</code>.</p>
<p>If <code>byte-order</code> is not provided, it defaults to <a href="coffi.mem.html#var-native-endian">native-endian</a>.</p>
</div></div><div class="src-link"><a href="https://github.com/IGJoshua/coffi/blob/8fd68fd2ac43bef595250e7fdf324e03287883ba/src/clj/coffi/mem.clj#L419">view source</a></div></div><div class="public anchor" id="var-read-float"><h3>read-float</h3><div class="usage"><code>(read-float segment)</code><code>(read-float segment offset)</code><code>(read-float segment offset byte-order)</code></div><div class="doc"><div class="markdown"><p>Reads a <a href="null">float</a> from the <code>segment</code>, at an optional <code>offset</code>.</p>
<p>If <code>byte-order</code> is not provided, it defaults to <a href="coffi.mem.html#var-native-endian">native-endian</a>.</p>
</div></div><div class="src-link"><a href="https://github.com/IGJoshua/coffi/blob/8fd68fd2ac43bef595250e7fdf324e03287883ba/src/clj/coffi/mem.clj#L394">view source</a></div></div><div class="public anchor" id="var-read-int"><h3>read-int</h3><div class="usage"><code>(read-int segment)</code><code>(read-int segment offset)</code><code>(read-int segment offset byte-order)</code></div><div class="doc"><div class="markdown"><p>Reads a <a href="null">int</a> from the <code>segment</code>, at an optional <code>offset</code>.</p>
<p>If <code>byte-order</code> is not provided, it defaults to <a href="coffi.mem.html#var-native-endian">native-endian</a>.</p>
</div></div><div class="src-link"><a href="https://github.com/IGJoshua/coffi/blob/8fd68fd2ac43bef595250e7fdf324e03287883ba/src/clj/coffi/mem.clj#L328">view source</a></div></div><div class="public anchor" id="var-read-long"><h3>read-long</h3><div class="usage"><code>(read-long segment)</code><code>(read-long segment offset)</code><code>(read-long segment offset byte-order)</code></div><div class="doc"><div class="markdown"><p>Reads a <a href="null">long</a> from the <code>segment</code>, at an optional <code>offset</code>.</p>
<p>If <code>byte-order</code> is not provided, it defaults to <a href="coffi.mem.html#var-native-endian">native-endian</a>.</p>
</div></div><div class="src-link"><a href="https://github.com/IGJoshua/coffi/blob/8fd68fd2ac43bef595250e7fdf324e03287883ba/src/clj/coffi/mem.clj#L353">view source</a></div></div><div class="public anchor" id="var-read-short"><h3>read-short</h3><div class="usage"><code>(read-short segment)</code><code>(read-short segment offset)</code><code>(read-short segment offset byte-order)</code></div><div class="doc"><div class="markdown"><p>Reads a <a href="null">short</a> from the <code>segment</code>, at an optional <code>offset</code>.</p>
<p>If <code>byte-order</code> is not provided, it defaults to <a href="coffi.mem.html#var-native-endian">native-endian</a>.</p>
</div></div><div class="src-link"><a href="https://github.com/IGJoshua/coffi/blob/8fd68fd2ac43bef595250e7fdf324e03287883ba/src/clj/coffi/mem.clj#L303">view source</a></div></div><div class="public anchor" id="var-reinterpret"><h3>reinterpret</h3><div class="usage"><code>(reinterpret segment size)</code><code>(reinterpret segment size arena)</code><code>(reinterpret segment size arena cleanup)</code></div><div class="doc"><div class="markdown"><p>Reinterprets the <code>segment</code> as having the passed <code>size</code>.</p>
<p>If <code>arena</code> is passed, the scope of the <code>segment</code> is associated with the arena, as well as its access constraints. If <code>cleanup</code> is passed, it will be a 1-argument function of a fresh memory segment backed by the same memory as the returned segment which should perform any required cleanup operations. It will be called when the <code>arena</code> is closed.</p>
</div></div><div class="src-link"><a href="https://github.com/IGJoshua/coffi/blob/8fd68fd2ac43bef595250e7fdf324e03287883ba/src/clj/coffi/mem.clj#L140">view source</a></div></div><div class="public anchor" id="var-seq-of"><h3>seq-of</h3><div class="usage"><code>(seq-of type segment)</code></div><div class="doc"><div class="markdown"><p>Constructs a lazy sequence of <code>type</code> elements deserialized from <code>segment</code>.</p>
</div></div><div class="src-link"><a href="https://github.com/IGJoshua/coffi/blob/8fd68fd2ac43bef595250e7fdf324e03287883ba/src/clj/coffi/mem.clj#L1106">view source</a></div></div><div class="public anchor" id="var-serialize"><h3>serialize</h3><div class="usage"><code>(serialize obj type)</code><code>(serialize obj type arena)</code></div><div class="doc"><div class="markdown"><p>Serializes an arbitrary type.</p>
<p>For types which have a primitive representation, this serializes into that representation. For types which do not, it allocates a new segment and serializes into that.</p>
</div></div><div class="src-link"><a href="https://github.com/IGJoshua/coffi/blob/8fd68fd2ac43bef595250e7fdf324e03287883ba/src/clj/coffi/mem.clj#L956">view source</a></div></div><div class="public anchor" id="var-serialize*"><h3>serialize*</h3><h4 class="type">multimethod</h4><div class="usage"></div><div class="doc"><div class="markdown"><p>Constructs a serialized version of the <code>obj</code> and returns it.</p>
<p>Any new allocations made during the serialization should be tied to the given <code>arena</code>, except in extenuating circumstances.</p>
<p>This method should only be implemented for types that serialize to primitives.</p>
</div></div><div class="src-link"><a href="https://github.com/IGJoshua/coffi/blob/8fd68fd2ac43bef595250e7fdf324e03287883ba/src/clj/coffi/mem.clj#L827">view source</a></div></div><div class="public anchor" id="var-serialize-into"><h3>serialize-into</h3><h4 class="type">multimethod</h4><div class="usage"></div><div class="doc"><div class="markdown"><p>Writes a serialized version of the <code>obj</code> to the given <code>segment</code>.</p>
<p>Any new allocations made during the serialization should be tied to the given <code>arena</code>, except in extenuating circumstances.</p>
<p>This method should be implemented for any type which does not override <a href="coffi.mem.html#var-c-layout">c-layout</a>.</p>
<p>For any other type, this will serialize it as <a href="coffi.mem.html#var-serialize*">serialize*</a> before writing the result value into the <code>segment</code>.</p>
</div></div><div class="src-link"><a href="https://github.com/IGJoshua/coffi/blob/8fd68fd2ac43bef595250e7fdf324e03287883ba/src/clj/coffi/mem.clj#L887">view source</a></div></div><div class="public anchor" id="var-shared-arena"><h3>shared-arena</h3><div class="usage"><code>(shared-arena)</code></div><div class="doc"><div class="markdown"><p>Constructs a new shared memory arena.</p>
<p>This arena can be shared across threads and memory allocated in it will only be cleaned up once any thread accessing the arena closes it.</p>
</div></div><div class="src-link"><a href="https://github.com/IGJoshua/coffi/blob/8fd68fd2ac43bef595250e7fdf324e03287883ba/src/clj/coffi/mem.clj#L53">view source</a></div></div><div class="public anchor" id="var-short-alignment"><h3>short-alignment</h3><div class="usage"></div><div class="doc"><div class="markdown"><p>The alignment in bytes of a c-sized short.</p>
</div></div><div class="src-link"><a href="https://github.com/IGJoshua/coffi/blob/8fd68fd2ac43bef595250e7fdf324e03287883ba/src/clj/coffi/mem.clj#L263">view source</a></div></div><div class="public anchor" id="var-short-layout"><h3>short-layout</h3><div class="usage"></div><div class="doc"><div class="markdown"><p>The <a href="null">MemoryLayout</a> for a c-sized short in <a href="coffi.mem.html#var-native-endian">native-endian</a> <a href="null">ByteOrder</a>.</p>
</div></div><div class="src-link"><a href="https://github.com/IGJoshua/coffi/blob/8fd68fd2ac43bef595250e7fdf324e03287883ba/src/clj/coffi/mem.clj#L211">view source</a></div></div><div class="public anchor" id="var-short-size"><h3>short-size</h3><div class="usage"></div><div class="doc"><div class="markdown"><p>The size in bytes of a c-sized short.</p>
</div></div><div class="src-link"><a href="https://github.com/IGJoshua/coffi/blob/8fd68fd2ac43bef595250e7fdf324e03287883ba/src/clj/coffi/mem.clj#L239">view source</a></div></div><div class="public anchor" id="var-size-of"><h3>size-of</h3><div class="usage"><code>(size-of type)</code></div><div class="doc"><div class="markdown"><p>The size in bytes of the given <code>type</code>.</p>
</div></div><div class="src-link"><a href="https://github.com/IGJoshua/coffi/blob/8fd68fd2ac43bef595250e7fdf324e03287883ba/src/clj/coffi/mem.clj#L806">view source</a></div></div><div class="public anchor" id="var-slice"><h3>slice</h3><div class="usage"><code>(slice segment offset)</code><code>(slice segment offset size)</code></div><div class="doc"><div class="markdown"><p>Get a slice over the <code>segment</code> with the given <code>offset</code>.</p>
</div></div><div class="src-link"><a href="https://github.com/IGJoshua/coffi/blob/8fd68fd2ac43bef595250e7fdf324e03287883ba/src/clj/coffi/mem.clj#L133">view source</a></div></div><div class="public anchor" id="var-slice-segments"><h3>slice-segments</h3><div class="usage"><code>(slice-segments segment size)</code></div><div class="doc"><div class="markdown"><p>Constructs a lazy seq of <code>size</code>-length memory segments, sliced from <code>segment</code>.</p>
</div></div><div class="src-link"><a href="https://github.com/IGJoshua/coffi/blob/8fd68fd2ac43bef595250e7fdf324e03287883ba/src/clj/coffi/mem.clj#L182">view source</a></div></div><div class="public anchor" id="var-write-address"><h3>write-address</h3><div class="usage"><code>(write-address segment value)</code><code>(write-address segment offset value)</code></div><div class="doc"><div class="markdown"><p>Writes the address of the <a href="null">MemorySegment</a> <code>value</code> to the <code>segment</code>, at an optional <code>offset</code>.</p>
</div></div><div class="src-link"><a href="https://github.com/IGJoshua/coffi/blob/8fd68fd2ac43bef595250e7fdf324e03287883ba/src/clj/coffi/mem.clj#L642">view source</a></div></div><div class="public anchor" id="var-write-byte"><h3>write-byte</h3><div class="usage"><code>(write-byte segment value)</code><code>(write-byte segment offset value)</code></div><div class="doc"><div class="markdown"><p>Writes a <a href="null">byte</a> to the <code>segment</code>, at an optional <code>offset</code>.</p>
</div></div><div class="src-link"><a href="https://github.com/IGJoshua/coffi/blob/8fd68fd2ac43bef595250e7fdf324e03287883ba/src/clj/coffi/mem.clj#L460">view source</a></div></div><div class="public anchor" id="var-write-char"><h3>write-char</h3><div class="usage"><code>(write-char segment value)</code><code>(write-char segment offset value)</code></div><div class="doc"><div class="markdown"><p>Writes a <a href="null">char</a> to the <code>segment</code>, at an optional <code>offset</code>.</p>
</div></div><div class="src-link"><a href="https://github.com/IGJoshua/coffi/blob/8fd68fd2ac43bef595250e7fdf324e03287883ba/src/clj/coffi/mem.clj#L562">view source</a></div></div><div class="public anchor" id="var-write-double"><h3>write-double</h3><div class="usage"><code>(write-double segment value)</code><code>(write-double segment offset value)</code><code>(write-double segment offset byte-order value)</code></div><div class="doc"><div class="markdown"><p>Writes a <a href="null">double</a> to the <code>segment</code>, at an optional <code>offset</code>.</p>
<p>If <code>byte-order</code> is not provided, it defaults to <a href="coffi.mem.html#var-native-endian">native-endian</a>.</p>
</div></div><div class="src-link"><a href="https://github.com/IGJoshua/coffi/blob/8fd68fd2ac43bef595250e7fdf324e03287883ba/src/clj/coffi/mem.clj#L614">view source</a></div></div><div class="public anchor" id="var-write-float"><h3>write-float</h3><div class="usage"><code>(write-float segment value)</code><code>(write-float segment offset value)</code><code>(write-float segment offset byte-order value)</code></div><div class="doc"><div class="markdown"><p>Writes a <a href="null">float</a> to the <code>segment</code>, at an optional <code>offset</code>.</p>
<p>If <code>byte-order</code> is not provided, it defaults to <a href="coffi.mem.html#var-native-endian">native-endian</a>.</p>
</div></div><div class="src-link"><a href="https://github.com/IGJoshua/coffi/blob/8fd68fd2ac43bef595250e7fdf324e03287883ba/src/clj/coffi/mem.clj#L586">view source</a></div></div><div class="public anchor" id="var-write-int"><h3>write-int</h3><div class="usage"><code>(write-int segment value)</code><code>(write-int segment offset value)</code><code>(write-int segment offset byte-order value)</code></div><div class="doc"><div class="markdown"><p>Writes a <a href="null">int</a> to the <code>segment</code>, at an optional <code>offset</code>.</p>
<p>If <code>byte-order</code> is not provided, it defaults to <a href="coffi.mem.html#var-native-endian">native-endian</a>.</p>
</div></div><div class="src-link"><a href="https://github.com/IGJoshua/coffi/blob/8fd68fd2ac43bef595250e7fdf324e03287883ba/src/clj/coffi/mem.clj#L506">view source</a></div></div><div class="public anchor" id="var-write-long"><h3>write-long</h3><div class="usage"><code>(write-long segment value)</code><code>(write-long segment offset value)</code><code>(write-long segment offset byte-order value)</code></div><div class="doc"><div class="markdown"><p>Writes a <a href="null">long</a> to the <code>segment</code>, at an optional <code>offset</code>.</p>
<p>If <code>byte-order</code> is not provided, it defaults to <a href="coffi.mem.html#var-native-endian">native-endian</a>.</p>
</div></div><div class="src-link"><a href="https://github.com/IGJoshua/coffi/blob/8fd68fd2ac43bef595250e7fdf324e03287883ba/src/clj/coffi/mem.clj#L534">view source</a></div></div><div class="public anchor" id="var-write-short"><h3>write-short</h3><div class="usage"><code>(write-short segment value)</code><code>(write-short segment offset value)</code><code>(write-short segment offset byte-order value)</code></div><div class="doc"><div class="markdown"><p>Writes a <a href="null">short</a> to the <code>segment</code>, at an optional <code>offset</code>.</p>
<p>If <code>byte-order</code> is not provided, it defaults to <a href="coffi.mem.html#var-native-endian">native-endian</a>.</p>
</div></div><div class="src-link"><a href="https://github.com/IGJoshua/coffi/blob/8fd68fd2ac43bef595250e7fdf324e03287883ba/src/clj/coffi/mem.clj#L478">view source</a></div></div></div></body></html>