docs/doc/reference/com/google/android/exoplayer2/upstream/Allocator.html
Package com.google.android.exoplayer2.upstream
DefaultAllocator[@Deprecated](https://developer.android.com/reference/java/lang/Deprecated.html "class or interface in java.lang")public interfaceAllocator
Deprecated. com.google.android.exoplayer2 is deprecated. Please migrate to androidx.media3 (which contains the same ExoPlayer code). See the migration guide for more details, including a script to help with the migration.
A source of allocations.
Nested Classes | Modifier and Type | Interface | Description |
| --- | --- | --- |
| static interface | Allocator.AllocationNode |
Deprecated.
A node in a chain of Allocations.
|
All Methods Instance Methods Abstract Methods Deprecated Methods | Modifier and Type | Method | Description |
| --- | --- | --- |
| Allocation | allocate() |
Deprecated.
Obtain an Allocation.
|
| int | getIndividualAllocationLength() |
Deprecated.
Returns the length of each individual Allocation.
|
| int | getTotalBytesAllocated() |
Deprecated.
Returns the total number of bytes currently allocated.
|
| void | release(Allocation allocation) |
Deprecated.
Releases an Allocation back to the allocator.
|
| void | release(Allocator.AllocationNode allocationNode) |
Deprecated.
Releases all Allocations in the chain starting at the given Allocator.AllocationNode.
|
| void | trim() |
Deprecated.
Hints to the allocator that it should make a best effort to release any excess Allocations.
|
-
[Allocation](Allocation.html "class in com.google.android.exoplayer2.upstream")allocate()
Deprecated.
Obtain an Allocation.
When the caller has finished with the Allocation, it should be returned by calling release(Allocation).
Returns:The Allocation.
-
void release([Allocation](Allocation.html "class in com.google.android.exoplayer2.upstream")allocation)
Deprecated.
Releases an Allocation back to the allocator.
Parameters:allocation - The Allocation being released.
-
void release([Allocator.AllocationNode](Allocator.AllocationNode.html "interface in com.google.android.exoplayer2.upstream")allocationNode)
Deprecated.
Releases all Allocations in the chain starting at the given Allocator.AllocationNode.
Implementations must not make memory allocations.
-
void trim()
Deprecated.
Hints to the allocator that it should make a best effort to release any excess Allocations.
-
int getTotalBytesAllocated()
Deprecated.
Returns the total number of bytes currently allocated.
-
int getIndividualAllocationLength()
Deprecated.
Returns the length of each individual Allocation.