Skip to content

v0.10.0

Latest

Choose a tag to compare

@lalinsky lalinsky released this 26 Oct 15:18
· 4 commits to main since this release

Added

  • Support for Zig 0.17, alongside 0.16
  • Decoding fixed-size arrays ([N]T), which could already be encoded
  • Decoding single-item pointers (*T, ?*T), including recursive types; a type holding a pointer to a struct or union decodes and encodes with anyerror

Changed

  • Encoding writes straight into the writer's buffer when there is room, and keeps the drain path out of line, which is about 13% cheaper on a typical struct and 37% on an array of integers
  • Encoding a struct is about 25% cheaper again, by telling the compiler that writing into the buffer cannot change the writer itself

Fixed

  • Decoding numbers from a streaming reader whose buffer is smaller than the number (under 8 bytes) works, instead of failing with error.ReaderBufferTooSmall; that error is now only for strings that have to be buffered whole, such as struct field names