Module pool

Module pool 

Source
Expand description

Memory pooling for frequent allocations

This module provides memory pools for common allocation patterns:

  • Block buffer pool (reuse Bytes allocations)
  • CID string pool (deduplicate strings)
  • IPLD node pool

Memory pooling reduces allocator pressure by reusing existing allocations.

Structs§

BytesPool
A pool of reusable byte buffers
CidStringPool
A pool for CID strings to reduce duplication
PoolStats
Statistics for a memory pool

Functions§

freeze_bytes
Helper to convert BytesMut to Bytes efficiently
global_bytes_pool
Get the global bytes pool
global_cid_string_pool
Get the global CID string pool