Skip to content

Commit 2ab9fe6

Browse files
committed
Increase library cache size in MarshalModuleBuiltins.LoadsNode and update formatting + licenses.
1 parent e500a4b commit 2ab9fe6

File tree

4 files changed

+10
-11
lines changed

4 files changed

+10
-11
lines changed

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/modules/MarshalModuleBuiltins.java

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2017, 2021, Oracle and/or its affiliates.
2+
* Copyright (c) 2017, 2022, Oracle and/or its affiliates.
33
* Copyright (c) 2013, Regents of the University of California
44
*
55
* All rights reserved.
@@ -79,7 +79,6 @@
7979
import com.oracle.graal.python.lib.PyTupleCheckExactNodeGen;
8080
import com.oracle.graal.python.lib.PyUnicodeCheckExactNodeGen;
8181
import com.oracle.graal.python.nodes.ErrorMessages;
82-
import com.oracle.graal.python.nodes.PRaiseNode;
8382
import com.oracle.graal.python.nodes.call.special.LookupAndCallBinaryNode;
8483
import com.oracle.graal.python.nodes.function.PythonBuiltinBaseNode;
8584
import com.oracle.graal.python.nodes.function.PythonBuiltinNode;
@@ -200,16 +199,16 @@ Object doit(VirtualFrame frame, Object file,
200199
@GenerateNodeFactory
201200
abstract static class LoadsNode extends PythonUnaryClinicBuiltinNode {
202201

203-
@Specialization(limit = "3")
202+
@Specialization
204203
Object doit(VirtualFrame frame, Object buffer,
205-
@CachedLibrary("buffer") PythonBufferAccessLibrary bufferLib) {
204+
@CachedLibrary(limit = "3") PythonBufferAccessLibrary bufferLib) {
206205
try {
207206
return Marshal.load(bufferLib.getInternalOrCopiedByteArray(buffer), bufferLib.getBufferLength(buffer));
208207
} catch (NumberFormatException e) {
209208
throw raise(PythonBuiltinClassType.ValueError, ErrorMessages.BAD_MARSHAL_DATA_S, e.getMessage());
210209
} catch (Marshal.MarshalError me) {
211210
throw raise(me.type, me.message, me.arguments);
212-
} finally {
211+
} finally {
213212
bufferLib.release(buffer, frame, this);
214213
}
215214
}

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/modules/cext/PythonCextBuiltins.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2017, 2021, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2017, 2022, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* The Universal Permissive License (UPL), Version 1.0

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/modules/ctypes/CDataObject.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2021, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2021, 2022, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* The Universal Permissive License (UPL), Version 1.0

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/objects/buffer/PythonBufferAccessLibrary.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2021, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2021, 2022, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* The Universal Permissive License (UPL), Version 1.0
@@ -102,9 +102,9 @@ public static void assertIsBuffer(Object receiver) {
102102
* Release the buffer. Equivalent of CPython's {@code PyBuffer_Release}, but must not be called
103103
* multiple times on the same buffer. If the caller has access to a VirtualFrame
104104
* {@link #release(Object, VirtualFrame, PNodeWithRaiseAndIndirectCall)} or
105-
* {@link #release(Object, VirtualFrame, PythonContext, PythonLanguage, IndirectCallNode)} should be used.
106-
* If the caller doesn't have access to a VirtualFrame it must be ensured that an IndirectCallContext
107-
* was already created in the call path.
105+
* {@link #release(Object, VirtualFrame, PythonContext, PythonLanguage, IndirectCallNode)}
106+
* should be used. If the caller doesn't have access to a VirtualFrame it must be ensured that
107+
* an IndirectCallContext was already created in the call path.
108108
*/
109109
public void release(@SuppressWarnings("unused") Object receiver) {
110110
}

0 commit comments

Comments
 (0)