mirror of
https://github.com/samsonjs/media.git
synced 2026-03-26 09:35:47 +00:00
Add more information to unexpected assertion failure
Issue: #4532 ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=208968252
This commit is contained in:
parent
80f5b7e7b2
commit
94c7fbbc24
1 changed files with 12 additions and 2 deletions
|
|
@ -118,8 +118,18 @@ public final class DefaultAllocator implements Allocator {
|
|||
}
|
||||
for (Allocation allocation : allocations) {
|
||||
// Weak sanity check that the allocation probably originated from this pool.
|
||||
Assertions.checkArgument(allocation.data == initialAllocationBlock
|
||||
|| allocation.data.length == individualAllocationSize);
|
||||
if (allocation.data != initialAllocationBlock
|
||||
&& allocation.data.length != individualAllocationSize) {
|
||||
throw new IllegalArgumentException(
|
||||
"Unexpected allocation: "
|
||||
+ System.identityHashCode(allocation.data)
|
||||
+ ", "
|
||||
+ System.identityHashCode(initialAllocationBlock)
|
||||
+ ", "
|
||||
+ allocation.data.length
|
||||
+ ", "
|
||||
+ individualAllocationSize);
|
||||
}
|
||||
availableAllocations[availableCount++] = allocation;
|
||||
}
|
||||
allocatedCount -= allocations.length;
|
||||
|
|
|
|||
Loading…
Reference in a new issue