mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 23:04:50 +02:00
8318586: Explicitly handle upcall stub allocation failure
8318653: UpcallTestHelper::runInNewProcess waits for forked process without timeout Reviewed-by: shade, mcimadamore
This commit is contained in:
parent
630bafd9c6
commit
e96e191952
21 changed files with 207 additions and 20 deletions
|
@ -71,6 +71,9 @@ public class NativeEntryPoint {
|
|||
return NEP_CACHE.get(key, k -> {
|
||||
long downcallStub = makeDowncallStub(methodType, abi, argMoves, returnMoves, needsReturnBuffer,
|
||||
capturedStateMask, needsTransition);
|
||||
if (downcallStub == 0) {
|
||||
throw new OutOfMemoryError("Failed to allocate downcall stub");
|
||||
}
|
||||
NativeEntryPoint nep = new NativeEntryPoint(methodType, downcallStub);
|
||||
CLEANER.register(nep, () -> freeDowncallStub(downcallStub));
|
||||
return nep;
|
||||
|
|
|
@ -106,6 +106,9 @@ public class UpcallLinker {
|
|||
doBindings = insertArguments(exactInvoker(doBindings.type()), 0, doBindings);
|
||||
long entryPoint = makeUpcallStub(doBindings, abi, conv,
|
||||
callingSequence.needsReturnBuffer(), callingSequence.returnBufferSize());
|
||||
if (entryPoint == 0) {
|
||||
throw new OutOfMemoryError("Failed to allocate upcall stub");
|
||||
}
|
||||
return UpcallStubs.makeUpcall(entryPoint, scope);
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue