setCheckSEXP
Validate SEXP Rapi Object Pointers

Description

Enables or disables validation of SEXP Rapi object pointers.

Usage

setCheckSEXP(value)

Arguments

value a logical value. Specifies whether to enable the SEXP check table.

Details

The .Call and .External functions pass Rapi object pointers (with the C type SEXP) to a C function, which should return an SEXP value. The C function can call into the engine, passing SEXP arguments to Rapi entry functions.
If the C function has a mistake, it might pass the engine a garbage value as an SEXP argument, or it might return a garbage pointer. If the engine tries to follow this pointer, it can cause a segmentation fault and crash the process.
To avoid this possible outcome, Spotfire Enterprise Runtime for R optionally maintains a hash table containing all of the known SEXP pointers. Spotfire Enterprise Runtime for R uses this table to check each SEXP it is given, giving an error or a warning if a bad SEXP is found, rather than crashing. This behavior is optional because updating and checking this table significantly decreases the performance of the engine. Currently, the hash table is disabled by default when Spotfire Enterprise Runtime for R starts.
The setCheckSEXP function is used to enable or disable this table of SEXP values.
Value
returns the previous value of the SEXP check table flag: either TRUE or FALSE. If value is NA, the existing value is returned without changing anything.
See Also
.Call.
Examples
## return whether SEXP values are checked
terrUtils::setCheckSEXP(NA)
Package terrUtils version 6.1.1-7
Package Index