BufferAllocator

sealed interface BufferAllocator

Strategy for allocating buffers during compression/decompression. Allows control over memory allocation to optimize for different use cases.

Inheritors

Types

Link copied to clipboard
object Companion
Link copied to clipboard
data object Direct : BufferAllocator

Allocate buffers using direct memory (default).

Link copied to clipboard
class FromPool(val pool: BufferPool) : BufferAllocator

Allocate buffers from a buffer pool for reuse.

Link copied to clipboard
value class FromZone(val zone: AllocationZone = AllocationZone.Direct) : BufferAllocator

Allocate buffers from a specific memory zone. Use Direct for I/O operations, Heap for compute-heavy operations.

Link copied to clipboard
data object Heap : BufferAllocator

Allocate buffers using heap memory.

Functions

Link copied to clipboard
abstract fun allocate(size: Int): ReadWriteBuffer

Allocates a buffer of the specified size.