File tree Expand file tree Collapse file tree 2 files changed +5
-1
lines changed
src/main/java/org/truffleruby/cext Expand file tree Collapse file tree 2 files changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -104,7 +104,6 @@ public synchronized long createNativeHandle(ValueWrapper wrapper) {
104
104
}
105
105
wrapper .setHandle (handleAddress );
106
106
addToHandleMap (handleAddress , wrapper );
107
- context .getMarkingService ().keepObject (wrapper );
108
107
addFinalizer (wrapper , handlePointer );
109
108
return handleAddress ;
110
109
}
Original file line number Diff line number Diff line change @@ -53,13 +53,18 @@ public static abstract class ForeignAsPointerNode extends Node {
53
53
54
54
@ CompilationFinal private RubyContext context ;
55
55
private final BranchProfile createHandleProfile = BranchProfile .create ();
56
+ private final BranchProfile taggedObjectProfile = BranchProfile .create ();
56
57
57
58
protected long access (VirtualFrame frame , ValueWrapper wrapper ) {
58
59
long handle = wrapper .getHandle ();
59
60
if (handle == ValueWrapperManager .UNSET_HANDLE ) {
60
61
createHandleProfile .enter ();
61
62
handle = getContext ().getValueWrapperManager ().createNativeHandle (wrapper );
62
63
}
64
+ if (ValueWrapperManager .isTaggedObject (handle )) {
65
+ taggedObjectProfile .enter ();
66
+ getContext ().getMarkingService ().keepObject (wrapper );
67
+ }
63
68
return handle ;
64
69
}
65
70
You can’t perform that action at this time.
0 commit comments