Skip to content

Commit 1fb2b56

Browse files
committed
adjust debug context to reserved immutable handles
1 parent 47d777c commit 1fb2b56

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/objects/cext/hpy/GraalHPyContext.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -791,7 +791,7 @@ public static GraalHPyNativeSymbol getGetterFunctionName(LLVMType llvmType) {
791791
}
792792
}
793793

794-
private static final int IMMUTABLE_HANDLE_COUNT = 256;
794+
protected static final int IMMUTABLE_HANDLE_COUNT = 256;
795795

796796
private GraalHPyHandle[] hpyHandleTable = new GraalHPyHandle[]{GraalHPyHandle.NULL_HANDLE};
797797
private int nextHandle = 1;

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/objects/cext/hpy/GraalHPyDebugContext.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@
4848
import com.oracle.graal.python.nodes.call.CallNode;
4949
import com.oracle.graal.python.util.PythonUtils;
5050
import com.oracle.truffle.api.CompilerDirectives.TruffleBoundary;
51+
import java.util.Arrays;
5152

5253
public final class GraalHPyDebugContext extends GraalHPyContext {
5354
private static final int DEFAULT_CLOSED_HANDLES_QUEUE_MAX_SIZE = 1024;
@@ -97,6 +98,8 @@ private void trackConstants() {
9798
trackHandle((GraalHPyHandle) member);
9899
}
99100
}
101+
assert debugHandleInfo.length <= IMMUTABLE_HANDLE_COUNT;
102+
debugHandleInfo = Arrays.copyOf(debugHandleInfo, IMMUTABLE_HANDLE_COUNT * 2);
100103
}
101104

102105
@Override

0 commit comments

Comments
 (0)