Placement of attributes

Ross Ihaka ihaka@stat.auckland.ac.nz
Tue, 24 Mar 1998 07:47:43 +1200 (NZST)


The PROTECT macro has to do with protecting an internal object from the
garbage collector.

	SEXP x;			/* x is an s-expression */
				/* i.e. an R object of some sort */

	x = allocate an object
	PROTECT(x) 	
	...
	UNPROTECT(x)

Every PROTECTED object must be UNPROTECTed before you exit from the
current function.  The interpreter keeps track of how may pointers
are protected at entry and checks that this is the same at exit.

I am hoping that medium term we will be able to switch from our
home-grown garbage-collector to the Boehm conservative collector.
This should fix all sorts of problems, but there are a couple of
save/restore problems which need to fixed before that.

	Ross
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-devel-request@stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._