Skip to content

Commit b757077

Browse files
committed
Fix import in NativeRope and adapt backport to older API
1 parent c13f130 commit b757077

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/main/java/org/truffleruby/core/rope/NativeRope.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
import com.oracle.truffle.api.profiles.ConditionProfile;
1313
import org.jcodings.Encoding;
1414
import org.jcodings.specific.ASCIIEncoding;
15+
import org.truffleruby.RubyContext;
1516
import org.truffleruby.core.FinalizationService;
1617
import org.truffleruby.core.string.StringAttributes;
1718
import org.truffleruby.core.string.StringSupport;
@@ -104,7 +105,7 @@ public NativeRope expandCapacity(RubyContext context, int newCapacity) {
104105
final Pointer pointer = Pointer.malloc(newCapacity + 1);
105106
pointer.writeBytes(0, this.pointer, 0, Math.min(getNativePointer().getSize(), newCapacity));
106107
pointer.writeByte(newCapacity, (byte) 0); // Like MRI
107-
pointer.enableAutorelease(context);
108+
pointer.enableAutorelease(context.getFinalizationService());
108109
return new NativeRope(
109110
pointer,
110111
byteLength(),

0 commit comments

Comments
 (0)