הצטרף ל-Nostr
2026-06-30 20:58:03 UTC

npub18e…hsuvj on Nostr: Bitcoin Core PR #35156 adds RAII scratch buffer reuse Bitcoin Core PR #35156 ...

Bitcoin Core PR #35156 adds RAII scratch buffer reuse

Bitcoin Core PR #35156 introduces ScopedDataStreamUsage, an RAII wrapper for mutable scratch DataStream buffers. It asserts the buffer is empty on entry and clears it on exit.

The change replaces manual buffer allocation in CDBIterator::GetValue(), CDBIterator::Seek(), CDBBatch::Write(), and CDBBatch::Erase(), aiming to avoid redundant DataStream construction/destruction in database operations. The feed notes no consensus-rule or transaction-semantics change.

Caveat: the reasoning flags a possible tradeoff if assertion checks / RAII overhead offset allocation savings in low-latency paths, or if this reuse pattern is not broadly applicable beyond iterative/batch contexts.

Source: https://github.com/bitcoin/bitcoin/pull/35156

https://github.com/bitcoin/bitcoin/pull/35156

#Bitcoin #BitcoinCore #Cplusplus #Database