Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
SDK
/
exoplayer
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
8d81bd58
authored
Jan 13, 2022
by
aquilescanta
Committed by
Ian Baker
Jan 14, 2022
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
Remove Allocator.release(Allocation[]) and references
PiperOrigin-RevId: 421530365
parent
755df46a
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
1 additions
and
18 deletions
library/core/src/main/java/com/google/android/exoplayer2/upstream/Allocator.java
library/core/src/main/java/com/google/android/exoplayer2/upstream/DefaultAllocator.java
library/core/src/main/java/com/google/android/exoplayer2/upstream/Allocator.java
View file @
8d81bd58
...
...
@@ -49,13 +49,6 @@ public interface Allocator {
void
release
(
Allocation
allocation
);
/**
* Releases an array of {@link Allocation Allocations} back to the allocator.
*
* @param allocations The array of {@link Allocation}s being released.
*/
void
release
(
Allocation
[]
allocations
);
/**
* Releases all {@link Allocation Allocations} in the chain starting at the given {@link
* AllocationNode}.
*
...
...
library/core/src/main/java/com/google/android/exoplayer2/upstream/DefaultAllocator.java
View file @
8d81bd58
...
...
@@ -31,7 +31,6 @@ public final class DefaultAllocator implements Allocator {
private
final
boolean
trimOnReset
;
private
final
int
individualAllocationSize
;
@Nullable
private
final
byte
[]
initialAllocationBlock
;
private
final
Allocation
[]
singleAllocationReleaseHolder
;
private
int
targetBufferSize
;
private
int
allocatedCount
;
...
...
@@ -76,7 +75,6 @@ public final class DefaultAllocator implements Allocator {
}
else
{
initialAllocationBlock
=
null
;
}
singleAllocationReleaseHolder
=
new
Allocation
[
1
];
}
public
synchronized
void
reset
()
{
...
...
@@ -114,16 +112,8 @@ public final class DefaultAllocator implements Allocator {
@Override
public
synchronized
void
release
(
Allocation
allocation
)
{
singleAllocationReleaseHolder
[
0
]
=
allocation
;
release
(
singleAllocationReleaseHolder
);
}
@Override
public
synchronized
void
release
(
Allocation
[]
allocations
)
{
for
(
Allocation
allocation
:
allocations
)
{
availableAllocations
[
availableCount
++]
=
allocation
;
}
allocatedCount
-=
allocations
.
length
;
allocatedCount
--;
// Wake up threads waiting for the allocated size to drop.
notifyAll
();
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment