Skip to content

Commit 8498ef0

Browse files
committed
Make classes PFileIO.FD/OwnFD final
1 parent 99c470c commit 8498ef0

File tree

1 file changed

+6
-5
lines changed
  • graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/modules/io

1 file changed

+6
-5
lines changed

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/modules/io/PFileIO.java

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,11 @@
4242

4343
import com.oracle.graal.python.builtins.objects.object.PythonBuiltinObject;
4444
import com.oracle.graal.python.runtime.AsyncHandler;
45+
import com.oracle.graal.python.runtime.AsyncHandler.SharedFinalizer.FinalizableReference;
4546
import com.oracle.graal.python.runtime.GilNode;
4647
import com.oracle.graal.python.runtime.PosixSupportLibrary;
4748
import com.oracle.graal.python.runtime.PythonContext;
48-
import com.oracle.truffle.api.CompilerDirectives;
49+
import com.oracle.truffle.api.CompilerDirectives.ValueType;
4950
import com.oracle.truffle.api.object.Shape;
5051

5152
public final class PFileIO extends PythonBuiltinObject {
@@ -174,8 +175,8 @@ public void setUTF8Write(boolean utf8Write) {
174175
}
175176
}
176177

177-
@CompilerDirectives.ValueType
178-
class FD {
178+
@ValueType
179+
final class FD {
179180
private final int fd;
180181
private final OwnFD ownFD;
181182

@@ -205,7 +206,7 @@ public int getFD() {
205206
}
206207
}
207208

208-
class OwnFD extends AsyncHandler.SharedFinalizer.FinalizableReference {
209+
final class OwnFD extends FinalizableReference {
209210

210211
private final PythonContext context;
211212

@@ -215,7 +216,7 @@ public OwnFD(Object referent, int fd, PythonContext context) {
215216
}
216217

217218
@SuppressWarnings("try")
218-
protected void doRelease() {
219+
void doRelease() {
219220
markReleased();
220221
try (GilNode.UncachedRelease gil = GilNode.uncachedRelease()) {
221222
PosixSupportLibrary.getUncached().close(context.getPosixSupport(), (int) getReference());

0 commit comments

Comments
 (0)