copybook-codec-memory
Core memory management utilities for copybook-codec, extracted as a dedicated crate.
Overview
Provides performance-critical memory patterns for high-throughput COBOL data processing: reusable scratch buffers to eliminate hot-path allocations, a deterministic worker pool for parallel record processing, and a streaming processor that enforces bounded memory usage (<256 MiB) for multi-GB files.
Usage
use ScratchBuffers;
// Reuse buffers across records to avoid allocation
let mut scratch = new;
scratch.digit_buffer.push;
scratch.byte_buffer.extend_from_slice;
scratch.string_buffer.push_str;
scratch.clear; // clears without deallocating
Public API
ScratchBuffers— Reusable byte/digit/string buffers for hot-path processingWorkerPool— Parallel record processing with deterministic output orderingStreamingProcessor— Memory-bounded streaming with pressure trackingSequenceRing/SequencedRecord— Re-exported fromcopybook-sequence-ring
License
AGPL-3.0-or-later