-
- All Implemented Interfaces:
-
com.facebook.common.memory.ByteArrayPool,com.facebook.common.memory.MemoryTrimmable,com.facebook.common.memory.Pool,com.facebook.common.memory.Pool,com.facebook.common.references.ResourceReleaser,com.facebook.common.references.ResourceReleaser
@ThreadSafe() public class GenericByteArrayPool extends BasePool<ByteArray> implements ByteArrayPool
A pool of byte arrays. The pool manages a number of byte arrays of a predefined set of sizes. This set of sizes is typically, but not required to be, based on powers of 2. The pool supports a get/release paradigm. On a get request, the pool attempts to find an existing byte array whose size is at least as big as the requested size. On a release request, the pool adds the byte array to the appropriate bucket. This byte array can then be used for a subsequent get request.
-
-
Field Summary
Fields Modifier and Type Field Description private final IntegerminBufferSizeprivate final MemoryTrimmableRegistrymMemoryTrimmableRegistryprivate final PoolParamsmPoolParamsprivate final SparseArray<Bucket<ByteArray>>mBucketsprivate final Set<ByteArray>mInUseValuesprivate final BasePool.CountermUsedprivate final BasePool.CountermFree
-
Constructor Summary
Constructors Constructor Description GenericByteArrayPool(MemoryTrimmableRegistry memoryTrimmableRegistry, PoolParams poolParams, PoolStatsTracker poolStatsTracker)
-
Method Summary
Modifier and Type Method Description final IntegergetMinBufferSize()-
Methods inherited from class com.facebook.imagepipeline.memory.GenericByteArrayPool
canAllocate, get, getBucket, getStats, getValue, initialize, isMaxSizeSoftCapExceeded, isReusable, newBucket, onParamsChanged, release, trim, trimToNothing, trimToSize, trimToSoftCap -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Constructor Detail
-
GenericByteArrayPool
GenericByteArrayPool(MemoryTrimmableRegistry memoryTrimmableRegistry, PoolParams poolParams, PoolStatsTracker poolStatsTracker)
-
-
Method Detail
-
getMinBufferSize
final Integer getMinBufferSize()
-
-
-
-