File tree Expand file tree Collapse file tree 1 file changed +5
-10
lines changed
graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/objects/array Expand file tree Collapse file tree 1 file changed +5
-10
lines changed Original file line number Diff line number Diff line change 47
47
// TODO interop library
48
48
@ ExportLibrary (PythonObjectLibrary .class )
49
49
public final class PArray extends PythonBuiltinObject {
50
- private BufferFormat format ;
51
- private String formatStr ;
50
+ private final BufferFormat format ;
51
+ private final String formatStr ;
52
52
private int length ;
53
53
private byte [] buffer ;
54
54
private volatile int exports ;
@@ -177,20 +177,15 @@ static boolean isBuffer(@SuppressWarnings("unused") PArray self) {
177
177
byte [] getBufferBytes (@ Exclusive @ Cached GilNode gil ) {
178
178
boolean mustRelease = gil .acquire ();
179
179
try {
180
- return PythonUtils .arrayCopyOf (buffer , getBufferLength (gil ));
180
+ return PythonUtils .arrayCopyOf (buffer , getBufferLength ());
181
181
} finally {
182
182
gil .release (mustRelease );
183
183
}
184
184
}
185
185
186
186
@ ExportMessage
187
- int getBufferLength (@ Exclusive @ Cached GilNode gil ) {
188
- boolean mustRelease = gil .acquire ();
189
- try {
190
- return length * format .bytesize ;
191
- } finally {
192
- gil .release (mustRelease );
193
- }
187
+ int getBufferLength () {
188
+ return length * format .bytesize ;
194
189
}
195
190
196
191
public enum MachineFormat {
You can’t perform that action at this time.
0 commit comments