RecyclingIntBlockAllocator

A IntBlockPool.Allocator implementation that recycles unused int blocks in a buffer and reuses them in subsequent calls to .intBlock.

Note: This class is not thread-safe

Constructors

Link copied to clipboard
constructor(blockSize: Int, maxBufferedBlocks: Int, bytesUsed: Counter)
constructor(blockSize: Int, maxBufferedBlocks: Int)
constructor()

Creates a new RecyclingIntBlockAllocator with a block size of , upper buffered docs limit of (DEFAULT_BUFFERED_BLOCKS).

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
open override val intBlock: IntArray

Functions

Link copied to clipboard
Link copied to clipboard
fun freeBlocks(num: Int): Int

Removes the given number of int blocks from the buffer if possible.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open override fun recycleIntBlocks(blocks: Array<IntArray>, start: Int, end: Int)