mirror of
https://github.com/corda/corda.git
synced 2025-01-03 19:54:13 +00:00
assert that there are no outstanding Get*Critical requests during allocation
When GetStringCritical or GetPrimitiveArrayCritical are called, the VM cannot risk new Java heap allocations until the corresponding release method is called because allocations may result in GC, which cannot happen while a string or array is pinned in memory. We already have a check for this latter in the footprint function used during GC, but it's best to catch the problem as early as possible.
This commit is contained in:
parent
57a67fb312
commit
5a07e04d56
@ -3458,6 +3458,8 @@ object
|
||||
allocate3(Thread* t, Allocator* allocator, Machine::AllocationType type,
|
||||
unsigned sizeInBytes, bool objectMask)
|
||||
{
|
||||
expect(t, t->criticalLevel == 0);
|
||||
|
||||
if (UNLIKELY(t->flags & Thread::UseBackupHeapFlag)) {
|
||||
expect(t, t->backupHeapIndex + ceiling(sizeInBytes, BytesPerWord)
|
||||
<= ThreadBackupHeapSizeInWords);
|
||||
|
Loading…
Reference in New Issue
Block a user