mirror of
https://github.com/samsonjs/media.git
synced 2026-04-27 15:07:40 +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
95bc60798e
commit
4662e586cd
1 changed files with 12 additions and 2 deletions
|
|
@ -118,8 +118,18 @@ public final class DefaultAllocator implements Allocator {
|
||||||
}
|
}
|
||||||
for (Allocation allocation : allocations) {
|
for (Allocation allocation : allocations) {
|
||||||
// Weak sanity check that the allocation probably originated from this pool.
|
// Weak sanity check that the allocation probably originated from this pool.
|
||||||
Assertions.checkArgument(allocation.data == initialAllocationBlock
|
if (allocation.data != initialAllocationBlock
|
||||||
|| allocation.data.length == individualAllocationSize);
|
&& allocation.data.length != individualAllocationSize) {
|
||||||
|
throw new IllegalArgumentException(
|
||||||
|
"Unexpected allocation: "
|
||||||
|
+ System.identityHashCode(allocation.data)
|
||||||
|
+ ", "
|
||||||
|
+ System.identityHashCode(initialAllocationBlock)
|
||||||
|
+ ", "
|
||||||
|
+ allocation.data.length
|
||||||
|
+ ", "
|
||||||
|
+ individualAllocationSize);
|
||||||
|
}
|
||||||
availableAllocations[availableCount++] = allocation;
|
availableAllocations[availableCount++] = allocation;
|
||||||
}
|
}
|
||||||
allocatedCount -= allocations.length;
|
allocatedCount -= allocations.length;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue