[Rd] R_MakeExternalPtr

TB thomas.baier at kirchnersoft.com
Mon Oct 24 10:12:30 CEST 2005


Hi,

I'm using R_MakeExternalPtr() to store handles to (COM) objects in a SEXP.

The code basically is

	sexp = R_MakeExternalPtr(handle,R_NilValue,R_NilValue);
	R_RegisterCFinalizerEx(...);

After creating the sexp, LENGTH(sexp) returns some quite large integer
value. It seems like an "unitialized" value.

Can I safely assume, that an SEXP of type EXTPTRSXP can only contain a
single pointer value and never represent a vector (an array) of pointers? Or
should I maybe explicitly add something like

	SETLENGTH(sexp,1);

Best wishes from sunny Austria,

Thomas Baier



More information about the R-devel mailing list