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
This commit was created on GitHub.com and signed with GitHub’s verified signature.
Performance and resource control
Bound Context-dependent array, list, tuple and generated-object formatters
once per Context, so steady-state serialization uses the selected formatter
directly instead of repeatedly walking the formatter graph.
Added exact-size byte[] serialization for eligible generated object types,
avoiding the intermediate-buffer-to-result copy while preserving the
MemoryPack wire format.
Added configurable retained serializer buffers. The default is an unpinned
8 KB buffer per active serializer thread, the high-throughput preset is an
unpinned 80 KB buffer, and applications can choose any size from 1 through Array.MaxLength.
Preserved the zero-allocation serializer hot path for pre-sized IBufferWriter<byte> destinations.
Added reproducible NuGet-only BenchmarkDotNet comparisons against
MemoryPack 1.21.4, including latency, throughput and allocation results.
Fixes for inherited MemoryPack issues
Fixed generated unmanaged structs ignoring member-level custom formatters.
MemoryPack's raw-copy path bypassed [MemoryPackCustomFormatter]; SharpPack
now honors [SharpPackCustomFormatter] at the root and through arrays,
lists, nullable values, tuples, key/value pairs, multidimensional arrays,
closed generic shapes and generated object graphs. Plain unmanaged types
keep the original raw-copy wire format and performance.
Fixed truncated unmanaged-list payloads mutating an existing destination
list before the payload byte count was validated. Both contiguous and
segmented inputs now fail before changing caller-owned collection state.
Fixed generated code for nested models losing required containing-type
modifiers and generic constraints. Nested models inside static, readonly, ref and constrained generic partial types now compile with the
correct containing declarations.
Correctness and compatibility
Fixed formatter-factory method-name and return-type collisions, recursive
Context factory construction, helper-name collisions and conditional generic
policy classification without falling back to process-wide formatter state.
Fixed nullable unmanaged List<T?> formatter selection and preserved custom
element formatter composition for explicit array formatters.
Added validation for custom retained-buffer sizes, exact writer bounds and
malformed or truncated bulk collection payloads.
Verified all 203 original-HEAD golden corpus entries in both directions,
including byte-for-byte equality for deterministic payloads. No wire-format
change is introduced by this release.