docs/javadoc/reference/com/facebook/imagepipeline/memory/BucketsBitmapPool.html
|
|
Summary: Ctors | Protected Methods | Inherited Methods | [Expand All]
public class
extends BasePool<V>
implements BitmapPool
| java.lang.Object | | ↳ | com.facebook.imagepipeline.memory.BasePool<V> | | | ↳ | com.facebook.imagepipeline.memory.BucketsBitmapPool |
Manages a pool of bitmaps. This allows us to reuse bitmaps instead of constantly allocating them (and pressuring the Java GC to garbage collect unused bitmaps).
The pool supports a get/release paradigm. get() allows for a bitmap in the pool to be reused if it matches the desired dimensions; if no such bitmap is found in the pool, a new one is allocated. release() returns a bitmap to the pool.
| Public Constructors |
|---|
| Creates an instance of a bitmap pool. |
| Protected Methods |
|---|
| Bitmap |
| Allocate a bitmap that has a backing memory allocation of 'size' bytes. |
| void |
| Frees the bitmap |
| int |
| Gets the bucketed size (typically something the same or larger than the requested size) |
| int |
| Gets the bucketed size of the value. |
| int |
| Gets the size in bytes for the given bucketed size |
| Bitmap |
| boolean |
Determine if this bitmap is reusable (i.e.) if subsequent get(int) requests can use this value. |
| [Expand] Inherited Methods | | --- | | From class com.facebook.imagepipeline.memory.BasePool
| abstract V | alloc(int bucketedSize) Allocates a new 'value' with the given size | | abstract void | free(V value) Frees the 'value' | | V | get(int size) Gets a new 'value' from the pool, if available. | | abstract int | getBucketedSize(int requestSize) Gets the bucketed size (typically something the same or larger than the requested size) | | abstract int | getBucketedSizeForValue(V value) Gets the bucketed size of the value | | abstract int | getSizeInBytes(int bucketedSize) Gets the size in bytes for the given bucketed size | | synchronized Map<String, Integer> | getStats() Export memory stats regarding buckets used, memory caps, reused values. | | synchronized V | getValue(Bucket<V> bucket) | | void | initialize() Finish pool initialization. | | boolean | isReusable(V value) Determines if the supplied value is 'reusable'. | | void | onParamsChanged() The pool parameters may have changed. | | void | release(V value) Releases the given value to the pool. | | void | trim(MemoryTrimType memoryTrimType) Trims the pool in response to low-memory states (invoked from MemoryManager) For now, we'll do the simplest thing, and simply clear out the entire pool. |
| | From class java.lang.Object
| Object | clone() | | boolean | equals(Object arg0) | | void | finalize() | | final Class<?> | getClass() | | int | hashCode() | | final void | notify() | | final void | notifyAll() | | String | toString() | | final void | wait(long arg0, int arg1) | | final void | wait(long arg0) | | final void | wait() |
| | From interface com.facebook.common.memory.MemoryTrimmable
| abstract void | trim(MemoryTrimType trimType) Trim memory. |
| | From interface com.facebook.common.memory.Pool
| abstract V | get(int size) Gets a 'value' of size 'S' (or larger) from the pool, if available. | | abstract void | release(V value) Releases the given value to the pool. |
| | From interface com.facebook.common.references.ResourceReleaser
| abstract void | release(T value) Release the given value. |
|
Creates an instance of a bitmap pool.
| memoryTrimmableRegistry | the memory manager to register with | | poolParams | pool parameters |
Allocate a bitmap that has a backing memory allocation of 'size' bytes. This is configuration agnostic so the size is the actual size in bytes of the bitmap.
| size | the 'size' in bytes of the bitmap |
Frees the bitmap
| value | the bitmap to free |
Gets the bucketed size (typically something the same or larger than the requested size)
| requestSize | the logical request size |
Gets the bucketed size of the value. We don't check the 'validity' of the value (beyond the not-null check). That's handled in isReusable(Bitmap)
| value | the value |
Gets the size in bytes for the given bucketed size
| bucketedSize | the bucketed size |
Determine if this bitmap is reusable (i.e.) if subsequent get(int) requests can use this value. The bitmap is reusable if - it has not already been recycled AND - it is mutable
| value | the value to test for reusability |
+Generated by Doclava. +