ArrayPool

interface ArrayPool

Interface for an array pool that pools arrays of different types.

Functions

Link copied to clipboard
abstract fun clearMemory()
Clears all arrays from the pool.
Link copied to clipboard
abstract fun <T> get(size: Int, arrayClass: Class<T>): T
Returns a non-null array of the given type with a length >= to the given size.
Link copied to clipboard
abstract fun <T> getExact(size: Int, arrayClass: Class<T>): T
Returns a non-null array of the given type with a length exactly equal to the given size.
Link copied to clipboard
abstract fun <T> put(array: T)
abstract fun <T> put(array: T, arrayClass: Class<T>)
Optionally adds the given array of the given type to the pool.
Link copied to clipboard
abstract fun trimMemory(level: Int)
Trims the size to the appropriate level.

Properties

Link copied to clipboard
val STANDARD_BUFFER_SIZE_BYTES: Int
A standard size to use to increase hit rates when the required size isn't defined.

Inheritors

Link copied to clipboard