Commit 8d81bd58 by aquilescanta Committed by Ian Baker

Remove Allocator.release(Allocation[]) and references

PiperOrigin-RevId: 421530365
parent 755df46a
......@@ -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}.
*
......
......@@ -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();
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment