Class LruArrayPool
java.lang.Object
com.bumptech.glide.load.engine.bitmap_recycle.LruArrayPool
- All Implemented Interfaces:
ArrayPool
A fixed size Array Pool that evicts arrays using an LRU strategy to keep the pool under the
maximum byte size.
-
Field Summary
Fields inherited from interface com.bumptech.glide.load.engine.bitmap_recycle.ArrayPool
STANDARD_BUFFER_SIZE_BYTES -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidClears all arrays from the pool.<T> TReturns a non-null array of the given type with a length>=to the given size.<T> TReturns a non-null array of the given type with a length exactly equal to the given size.<T> voidput(T array) Optionally adds the given array of the given type to the pool.<T> voidDeprecated.voidtrimMemory(int level) Trims the size to the appropriate level.
-
Constructor Details
-
LruArrayPool
public LruArrayPool() -
LruArrayPool
public LruArrayPool(int maxSize) Constructor for a new pool.- Parameters:
maxSize- The maximum size in integers of the pool.
-
-
Method Details
-
put
Deprecated.Description copied from interface:ArrayPoolOptionally adds the given array of the given type to the pool.Arrays may be ignored, for example if the array is larger than the maximum size of the pool.
-
put
public <T> void put(T array) Description copied from interface:ArrayPoolOptionally adds the given array of the given type to the pool.Arrays may be ignored, for example if the array is larger than the maximum size of the pool.
-
getExact
Description copied from interface:ArrayPoolReturns a non-null array of the given type with a length exactly equal to the given size.If an array of the given size isn't in the pool, a new one will be allocated.
This class makes no guarantees about the contents of the returned array.
-
get
Description copied from interface:ArrayPoolReturns a non-null array of the given type with a length>=to the given size.If an array of the given size isn't in the pool, a new one will be allocated.
This class makes no guarantees about the contents of the returned array.
-
clearMemory
public void clearMemory()Description copied from interface:ArrayPoolClears all arrays from the pool.- Specified by:
clearMemoryin interfaceArrayPool
-
trimMemory
public void trimMemory(int level) Description copied from interface:ArrayPoolTrims the size to the appropriate level.- Specified by:
trimMemoryin interfaceArrayPool- Parameters:
level- A trim specified inComponentCallbacks2.
-