FactoryPools

class FactoryPools

Provides implementations of Pool never return null, log when new instances are created, and that can use the com.bumptech.glide.util.pool.FactoryPools.Poolable interface to ensure objects aren't used while inside the pool.

Types

Link copied to clipboard
interface Factory<T>
Creates new instances of the given type.
Link copied to clipboard
interface Poolable
Allows additional verification to catch errors caused by using objects while they are in an object pool.
Link copied to clipboard
interface Resetter<T>
Resets state when objects are returned to the pool.

Functions

Link copied to clipboard
open fun <T : FactoryPools.Poolable?> simple(size: Int, factory: FactoryPools.Factory<T>): Pool<T>
Returns a non-thread safe Pool that never returns null from acquire and that contains objects of the type created by the given Factory with the given maximum size.
Link copied to clipboard
open fun <T : FactoryPools.Poolable?> threadSafe(size: Int, factory: FactoryPools.Factory<T>): Pool<T>
Returns a new thread safe Pool that never returns null from acquire and that contains objects of the type created by the given Factory with the given maximum size.
Link copied to clipboard
open fun <T> threadSafeList(): Pool<List<T>>
Returns a new Pool that never returns null and that contains Lists of a specific generic type with a standard maximum size of 20.
open fun <T> threadSafeList(size: Int): Pool<List<T>>
Returns a new thread safe Pool that never returns null and that contains Lists of a specific generic type with the given maximum size.