Skip to content

Commit

Permalink
Remove sexp_named()
Browse files Browse the repository at this point in the history
  • Loading branch information
lionel- committed Jul 2, 2024
1 parent 64f74dd commit 5634e96
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 24 deletions.
5 changes: 0 additions & 5 deletions R/obj.R
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,6 @@ sexp_address <- obj_address
poke_type <- function(x, type) {
invisible(.Call(ffi_poke_type, x, type))
}
sexp_named <- function(x) {
# Don't use `substitute()` because dots might be forwarded
arg <- match.call(expand.dots = FALSE)$x
.Call(ffi_named, arg, parent.frame())
}

mark_object <- function(x) {
invisible(.Call(ffi_mark_object, x))
Expand Down
1 change: 0 additions & 1 deletion src/internal/encoding.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ r_obj* obj_encode_utf8(r_obj* x) {
default: break;
}

// For performance, avoid `KEEP()` / `FREE()` when not needed
r_obj* attrib = r_attrib(x);
if (attrib != r_null) {
KEEP(x);
Expand Down
17 changes: 0 additions & 17 deletions src/internal/exported.c
Original file line number Diff line number Diff line change
Expand Up @@ -806,23 +806,6 @@ r_obj* ffi_promise_value(r_obj* x, r_obj* env) {
}
}

// Picks up symbols from parent environment to avoid bumping namedness
// during promise resolution
r_obj* ffi_named(r_obj* x, r_obj* env) {
int n_kept = 0;

x = PROTECT(Rf_findVarInFrame3(env, x, FALSE));
++n_kept;

if (TYPEOF(x) == PROMSXP) {
x = PROTECT(Rf_eval(x, env));
++n_kept;
}

UNPROTECT(n_kept);
return Rf_ScalarInteger(NAMED(x));
}

r_obj* ffi_find_var(r_obj* env, r_obj* sym) {
return Rf_findVar(sym, env);
}
Expand Down
1 change: 0 additions & 1 deletion src/internal/init.c
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,6 @@ static const R_CallMethodDef r_callables[] = {
{"ffi_lof_unwrap", (DL_FUNC) &ffi_lof_unwrap, 1},
{"ffi_mark_object", (DL_FUNC) &ffi_mark_object, 1},
{"ffi_missing_arg", (DL_FUNC) &ffi_missing_arg, 0},
{"ffi_named", (DL_FUNC) &ffi_named, 2},
{"ffi_names2", (DL_FUNC) &ffi_names2, 2},
{"ffi_names_as_unique", (DL_FUNC) &ffi_names_as_unique, 2},
{"ffi_new_call", (DL_FUNC) &ffi_new_call_node, 2},
Expand Down

0 comments on commit 5634e96

Please sign in to comment.