Skip to content

Commit 70638f3

Browse files
author
Pavel Marek
committed
[GR-36909] Implement SET_GROWABLE_BIT.
PullRequest: fastr/2720
2 parents dd0007b + 78d1ead commit 70638f3

File tree

7 files changed

+448
-408
lines changed

7 files changed

+448
-408
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# 22.2.0
22
* `--R.DebugLLVMLibs` is no longer a stable option.
3+
* Implemented `SET_GROWABLE_BIT` and `IS_GROWABLE` C API functions.
4+
* This fixes installation of the `cpp11` 0.2.6 package.
35

46
# 22.1.0
57
* Improved performance of the `order` and `rank` builtin functions

com.oracle.truffle.r.ffi.impl/src/com/oracle/truffle/r/ffi/impl/common/JavaUpCallsRFFIImpl.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -537,6 +537,16 @@ public int TRUELENGTH(Object x) {
537537
throw implementedAsNode();
538538
}
539539

540+
@Override
541+
public int IS_GROWABLE(Object x) {
542+
return guaranteeInstanceOf(x, RAbstractVector.class).isGrowable() ? 1 : 0;
543+
}
544+
545+
@Override
546+
public void SET_GROWABLE_BIT(Object x) {
547+
guaranteeInstanceOf(x, RAbstractVector.class).setGrowable();
548+
}
549+
540550
@Override
541551
public int LEVELS(Object x) {
542552
if (x instanceof RBaseObject) {

com.oracle.truffle.r.ffi.impl/src/com/oracle/truffle/r/ffi/impl/upcalls/StdUpCallsRFFI.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2014, 2021, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2014, 2022, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -314,6 +314,10 @@ public interface StdUpCallsRFFI {
314314
@RFFIUpCallNode(TRUELENGTHNode.class)
315315
int TRUELENGTH(Object x);
316316

317+
int IS_GROWABLE(Object x);
318+
319+
void SET_GROWABLE_BIT(Object x);
320+
317321
int LEVELS(Object x);
318322

319323
void SETLEVELS(Object x, int gpbits);

com.oracle.truffle.r.native/fficall/src/common/rffi_upcalls.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,8 @@ typedef void (*call_SETLENGTH)(SEXP x, int v);
178178
typedef void (*call_SET_TRUELENGTH)(SEXP x, int v);
179179
typedef R_xlen_t (*call_XLENGTH)(SEXP x);
180180
typedef R_xlen_t (*call_XTRUELENGTH)(SEXP x);
181+
typedef int (*call_IS_GROWABLE)(SEXP x);
182+
typedef void (*call_SET_GROWABLE_BIT)(SEXP x);
181183
typedef int (*call_LEVELS)(SEXP x);
182184
typedef int (*call_IS_LONG_VEC)(SEXP x);
183185
typedef int (*call_LEVELS)(SEXP x);

0 commit comments

Comments
 (0)