Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Q
QueryR
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Julien Lopez
QueryR
Commits
8f20921f
Commit
8f20921f
authored
7 years ago
by
Lukas Stadler
Browse files
Options
Downloads
Patches
Plain Diff
only ever create one CharSXPWrapper for NA
parent
4c46ae51
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/data/CharSXPWrapper.java
+9
-1
9 additions, 1 deletion
...src/com/oracle/truffle/r/runtime/data/CharSXPWrapper.java
with
9 additions
and
1 deletion
com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/data/CharSXPWrapper.java
+
9
−
1
View file @
8f20921f
...
...
@@ -22,6 +22,8 @@
*/
package
com.oracle.truffle.r.runtime.data
;
import
com.oracle.truffle.r.runtime.RRuntime
;
/**
* Internally GNU R distinguishes "strings" and "vectors of strings" using the {@code CHARSXP} and
* {@code STRSXP} types, respectively. Although this difference is invisible at the R level, it
...
...
@@ -32,6 +34,8 @@ package com.oracle.truffle.r.runtime.data;
* N.B. Use limited to RFFI implementations.
*/
public
final
class
CharSXPWrapper
extends
RObject
implements
RTruffleObject
{
private
static
final
CharSXPWrapper
NA
=
new
CharSXPWrapper
(
RRuntime
.
STRING_NA
);
private
String
contents
;
private
CharSXPWrapper
(
String
contents
)
{
...
...
@@ -48,7 +52,11 @@ public final class CharSXPWrapper extends RObject implements RTruffleObject {
}
public
static
CharSXPWrapper
create
(
String
contents
)
{
return
new
CharSXPWrapper
(
contents
);
if
(
contents
==
RRuntime
.
STRING_NA
)
{
return
NA
;
}
else
{
return
new
CharSXPWrapper
(
contents
);
}
}
public
long
allocateNativeContents
()
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment