def put_word_at

gralha-byte-words@0.1.0.0 · words.bend:306

import gralha-byte-words@0.1.0.0/words.bend as Words
import Base

306# Four bytes into a previously reserved output range. The destination may be
307# unaligned; its already-written low bytes are preserved and the high spill
308# becomes the prefix of the next word.
309def put_word_at(st: Sink, +v: U32) -> Sink:
310  match st:
311    case Sink{a, cap, pos}:
312      +p = pos
313      +q = (p >> 2n : U32)
314      +sh = ((p .&. 3) << 3n : U32)
315      ob_word_got(Array.get(U32, a, q), cap, p, q, sh, v)

Uses (7)

Used by (0)

No other definition uses this definition.