Revision history for Struct::Codec

0.11	2026-11-28
        - FREEZE and THAW. An object whose class has a FREEZE method is
          written as what FREEZE('Struct::Codec') returns, under the new tag
          0x39, and decoded by THAW('Struct::Codec', @values) on its class:
          the protocol of Types::Serialiser, CBOR::XS, Sereal and JSON::XS.
          It is how a pointer object is carried rather than refused or
          stripped, and how an object that keeps its state in C magic, as
          HAMT's containers do, is carried at all: before this one came back
          an empty shell with no error. Shared objects are thawed once; a
          cycle back into an object through its own FREEZE values is refused
          by name. Streams without such an object are unchanged.
        - For XS consumers: the ABI's encode, encode_to and decode call FREEZE
          and THAW as the Perl surface does, so an entry can run Perl code;
          sc_abi.h says so. The table is unchanged, at version 1.
        - FIXES a stream the encoder wrote that its decoder refused with
          "reference to a value that was not tracked": a tied scalar in two
          slots whose tie object was shared too. The scalar was registered
          after its tie object, out of the offset order the lookup searches.
        - FIXES canonical => 1 giving one hash's data different bytes when
          a key held a code point past 0x7FFFFFFF beside Latin-1 keys. Perl
          writes those in seven or thirteen bytes, the comparison read at
          most six, and the order it gave was not transitive.
        - FIXES a stream the encoder wrote that its decoder refused as a
          pointer object: an integer in a class with an XS DESTROY that
          perl had also cached as a float, as it does for an address once
          divided. It went out as the integer, so it is refused as one on
          encode, and strip_pointers drops it.
        - FIXES an object of class Regexp that is no regexp - bless {},
          'Regexp' - coming back unblessed, and a blessed scalar there
          being refused as "a Regexp with no pattern". A regexp is known by
          its type now, not by its class.

0.10	2026-10-21
        - canonical => 1 on struct_encode: every hash's keys in order, so
          equal data is equal bytes in any process.

0.09	2026-10-11
        - Builds on 5.10.0: HeUTF8 is defined where perl lacks it.

0.08	2026-09-20
        - t/34-pointers.t asked for 2**40 to be an integer, which it is not
          where ivsize is 4.

0.07	2026-09-19
        - A pointer object whose integer has been printed was encoded, not
          refused: before 5.36 perl marks the digits it caches as a string.
          A string that spells the integer back is the integer now, so the
          refusal is the same on every perl. A blessed decimal string used
          as a number has those flags too and is refused with it.

0.06	2026-09-19
        - Refuse a pointer object: a blessed integer scalar in a class with a
          DESTROY, on encode and on decode, so the copy's DESTROY never frees
          an address it does not own.
        - struct_encode takes strip_pointers => 1 to write such an object as
          undef instead.

0.05	2026-09-18
        - FIXES a heap corruption decoding a hash key of length zero that
          carries the UTF-8 flag. 
        - t/25-wide-nv.t used perl's numifier to build -1.797...e+308, which
          overflows to -Inf below 5.30, and an infinity compares against
          nothing. The exponent is divided out and the mantissa named.
        - t/14-corrupt.t asserted two refusals that only a 64-bit UV gives:
          an eleven-byte varint is refused for its width, not its length,
          where a UV is 32 bits, and the descriptor fixture is now a value
          past INT_MAX that still fits one.

0.04	2026-09-18
        - A float on a perl built -Dusequadmath kept one significant digit: a
          third came back 0.3, and on a 32-bit one perl died "panic:
          my_snprintf buffer overflow". The precision was passed as "%.*",
          which my_snprintf never hands to quadmath_snprintf. It is written
          into the format now, as perl's own sv.c does.
        - A float on a perl built -Duselongdouble below 5.30 came back a ULP
          or two out: the digits were read with Atof, which is perl's own
          numifier and was not correctly rounded until 5.30 (perl RT #41202).
          The decoder names strtold, strtoflt128 or strtod for the build.
        - Those digits now use '.' for a radix whatever the locale is.
        - t/25-wide-nv.t asserts the digit count on the bytes, and no longer
          uses perl's numifier as an oracle on a perl whose numifier is the
          thing at fault.

0.03	2026-09-17
        - FIXES a heap corruption when encoding an anonymous sub. The
          deparser is loaded with load_module, which runs perl and can
          reallocate the argument stack; the stack pointer taken before it
          was then stale, and pushing the deparse arguments through it wrote
          to freed memory. It surfaced only when the load triggered a
          realloc, so it depended on how deep the stack already was: a bare
          encode was usually fine and a sub encoded from inside a larger
          program crashed at destruction. SPAGAIN after the load. Seen as a
          SIGABRT/SIGSEGV in t/32-kinds.t on threaded 5.18.
        - t/16-leak.t built its probe list with a regexp unconditionally,
          which the codec refuses below 5.12, so the file died there on
          5.10. The regexp joins the list only where it can be encoded, as
          t/32 already skips it.
        - A float on a perl built -Duselongdouble or -Dusequadmath kept only
          what a double holds. Such a value now goes out as decimal digits
          under tag 0x38, and comes back the number it was. A perl whose NV
          is a double writes the same bytes as before.
        - t/25-wide-nv.t.

0.01	2026-09-12
        - First version.

