Skip to content

v0.0.19

Latest

Choose a tag to compare

@jinzhongjia jinzhongjia released this 16 Sep 07:54
· 1 commit to main since this release

MessagePack compliance and memory-safety fixes, plus independent standard-I/O APIs without breaking existing callers.

Fixes

  • Reject the reserved MessagePack marker 0xc1 with TypeMarkerReading, including array elements and map keys/values. Bytes inside data and length fields remain unaffected. Addresses #28.
  • Validate string lengths before allocating memory or reading string bodies.
  • Free owned payload trees without allocation or recursion, including when the allocator is exhausted.

Standard I/O

  • Add independent Encoder and Decoder APIs borrowing *std.Io.Writer and *std.Io.Reader.
  • Support runtime ParseLimits through Decoder.limits.
  • Handle short underlying transfers through writeAll / readSliceAll, propagate standard I/O errors, and leave flushing and resource ownership to the caller.
  • Preserve PackerIO.init, PackerIO.write/read, packIO(), their existing public fields, and the callback-based Pack / PackWithLimits APIs. Existing callers do not need to migrate.
  • Update English and Chinese documentation with working memory and file examples.

Compatibility and Maintenance

  • Continue supporting Zig 0.16.0 and Zig 0.17.0-dev; development-compiler compatibility may change as Zig evolves.
  • Remove obsolete pre-0.16 compatibility branches. The minimum supported compiler remains 0.16.0, unchanged from 0.0.18. Use library version 0.0.17 for Zig 0.15.x and older.
  • Synchronize build.zig.zon package metadata with release version 0.0.19.

Verification

  • Release-source tests and documentation generation pass on macOS arm64 with Zig 0.16.0 and 0.17.0-dev.2131+d08989840: 171/171 tests on each compiler.
  • The unchanged pre-refactor client test suite passes against the new implementation: 165/165 tests on both compilers. Original constructors, public fields, and stream retargeting were also exercised.
  • Native I/O was exercised with allocating writers, tiny-buffer real files, and loopback TCP carrying consecutive messages without requiring EOF.
  • All six runnable English/Chinese README examples and the ReleaseFast benchmark suite passed on both compilers during implementation verification.

Full Changelog: 0.0.18...0.0.19