Tags: blacktop/arm64-cgo
Tags
chore: add Decoder type for reusable cgo decode buffers Introduces a Decoder type that preallocates and reuses cgo-side C.Instruction buffers across multiple decode operations, reducing allocation overhead. The existing DecomposeInto and DecomposeBatch functions now wrap a short-lived Decoder to maintain API compatibility. The Engine now embeds a Decoder to avoid per-instruction allocations during emulation.
feat: add zero-allocation DecomposeInto and batch disassembly APIs Introduces stack-allocated instruction types (Inst, Op) and batch processing to eliminate heap allocations in hot paths: - DecomposeInto(): decode into caller-provided Inst - DecomposeBatch(): decode multiple instructions in one C call - Inst/Op: fixed-size types with MAX_OPERANDS/MAX_REGISTERS arrays - Lazy string formatting via Inst.Disassemble() - Operation-based dispatch via SupportsOp() interface Benchmarks show significant allocation reduction for decode-heavy workloads. Existing Decompose() API unchanged for compatibility.
PreviousNext