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 returns 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, TIBCO Enterprise Runtime for R optionally maintains a hash table containing all of
the known SEXP pointers. TIBCO 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.
The
setCheckSEXP function is used to enable or disable this table
of SEXP values.
- If value is set to TRUE, the hash table is enabled.
- If value is set to FALSE, the hash table is disbled.
- If value is set to NA, the current state is returned.
| Note | Enabling the SEXP checks is an
expensive operation because the engine has to scan through all objects.
|
Currently, this table is enabled by default when TIBCO Enterprise Runtime for R starts. In a
later release, this setting might be changed to be disabled by default.
| Warning | If this table is disabled, it is possible that TIBCO Enterprise Runtime for R might crash
if it calls external C code that produces garbage 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
setCheckSEXP(NA)