File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/data Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change 2626
2727import com .oracle .truffle .api .CompilerDirectives .TruffleBoundary ;
2828import com .oracle .truffle .r .runtime .RRuntime ;
29+ import com .oracle .truffle .r .runtime .Utils ;
30+
2931import java .lang .ref .WeakReference ;
3032import java .util .Map ;
3133import java .util .WeakHashMap ;
@@ -49,7 +51,7 @@ public final class CharSXPWrapper extends RObject implements RTruffleObject {
4951 private static final Map <CharSXPWrapper , WeakReference <CharSXPWrapper >> instances = new WeakHashMap <>(2048 );
5052
5153 private CharSXPWrapper (String contents ) {
52- this .contents = contents ;
54+ this .contents = Utils . intern ( contents ) ;
5355 }
5456
5557 @ TruffleBoundary
@@ -61,7 +63,7 @@ public String getContents() {
6163 return RRuntime .STRING_NA ;
6264 }
6365 // WARNING:
64- // we keep and use the contens value even in cases when contets got allocated and could be
66+ // we keep and use the contents value even in cases when contents got allocated and could be
6567 // accessed via NativeDataAccess.getData():
6668 // - when used with RSymbol the String has to be interned - NDA.getData() will create a new
6769 // instance if already allocated
You can’t perform that action at this time.
0 commit comments