public interface Allocator
Modifier and Type | Method and Description |
---|---|
Allocation |
allocate()
Obtain an
Allocation . |
int |
getIndividualAllocationLength()
Returns the length of each individual
Allocation . |
int |
getTotalBytesAllocated()
Returns the total number of bytes currently allocated.
|
void |
release(Allocation allocation)
Releases an
Allocation back to the allocator. |
void |
release(Allocation[] allocations)
Releases an array of
Allocation s back to the allocator. |
void |
trim()
Hints to the allocator that it should make a best effort to release any excess
Allocation s. |
Allocation allocate()
Allocation
.
When the caller has finished with the Allocation
, it should be returned by calling
release(Allocation)
.
Allocation
.void release(Allocation allocation)
Allocation
back to the allocator.allocation
- The Allocation
being released.void release(Allocation[] allocations)
Allocation
s back to the allocator.allocations
- The array of Allocation
s being released.void trim()
Allocation
s.int getTotalBytesAllocated()
int getIndividualAllocationLength()
Allocation
.