class

HT2::BufferPool

Inherits Reference < Object

Thread-safe pool of reusable byte buffers to reduce memory allocations during frame processing operations.

Constructors

new(max_pool_size : Int32 = 100, max_buffer_size : Int32 = 16384)
Source

Instance methods

acquire(size : Int32) : Bytes

Acquire a buffer of at least the specified size

Source
clear

Clear all buffers from the pool

Source
release(buffer : Bytes) : Nil

Release a buffer back to the pool

Source
stats

Get current pool statistics

Source