You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Aligned typed arrays enable zero-copy access by padding the data payload to the element type's natural alignment. The message buffer must be aligned to at least the maximum element alignment in the message.
-`NUMERIC_HEADER` — 1 byte, a standard numeric typed array header encoding the element category (bits 3–4: 0=float, 1=signed, 2=unsigned) and BYTE COUNT (bits 5–7). Bits 0–2 must be `0b100`.
249
+
-`SIZE` — compressed unsigned integer, element count.
250
+
-`PADDING_LENGTH` — 1 byte, number of padding bytes that follow (0 to `alignment - 1`).
251
+
-`PADDING` — `PADDING_LENGTH` bytes (contents unspecified, must be ignored by decoders).
252
+
-`DATA` — raw element data, aligned to `alignof(T)`.
where `offset_after_padding_length` is the byte offset from the start of the message buffer.
261
+
262
+
Aligned typed arrays must only encode numeric types. Boolean and string sub-types must not be used.
263
+
264
+
> Extensions that embed typed arrays (matrices, complex numbers) gain zero-copy support automatically by using an aligned typed array as the inner value.
<pclass="tagline">High performance, tagged binary data specification like JSON, MessagePack, CBOR, etc. But, designed for higher performance and scientific computing.</p>
<p>Aligned typed arrays enable zero-copy access by padding the data payload to the element type's natural alignment. The message buffer must be aligned to at least the maximum element alignment in the message.</p>
<li><code>NUMERIC_HEADER</code> — 1 byte, a standard numeric typed array header encoding the element category (bits 3–4: 0=float, 1=signed, 2=unsigned) and BYTE COUNT (bits 5–7). Bits 0–2 must be <code>0b100</code>.</li>
385
+
<li><code>SIZE</code> — compressed unsigned integer, element count.</li>
386
+
<li><code>PADDING_LENGTH</code> — 1 byte, number of padding bytes that follow (0 to <code>alignment - 1</code>).</li>
387
+
<li><code>PADDING</code> — <code>PADDING_LENGTH</code> bytes (contents unspecified, must be ignored by decoders).</li>
388
+
<li><code>DATA</code> — raw element data, aligned to <code>alignof(T)</code>.</li>
<p>where <code>offset_after_padding_length</code> is the byte offset from the start of the message buffer.</p>
393
+
<p>Aligned typed arrays must only encode numeric types. Boolean and string sub-types must not be used.</p>
394
+
<divclass="note">
395
+
<p>Extensions that embed typed arrays (matrices, complex numbers) gain zero-copy support automatically by using an aligned typed array as the inner value.</p>
396
+
</div>
397
+
378
398
<h4>5 - Generic Array</h4>
379
399
<p>Generic arrays expect elements to have headers.</p>
0 commit comments