From ross at biostat.ucsf.edu  Mon Mar 17 00:51:16 2014
From: ross at biostat.ucsf.edu (Ross Boylan)
Date: Sun, 16 Mar 2014 16:51:16 -0700
Subject: [Rd] Does R ever move objecsts in memory?
Message-ID: <20140316235116.GC14057@markov.biostat.ucsf.edu>

R objects can disappear if they are garbage collected; can they move,
i.e., change their location in memory?

I don't see any indication this might happen in "Writing R Extensions"
or "R Internals".  But I'd like to be sure.

Context: Rmpi serializes objects in raw vectors for transmission by
mpi.  Some send operations (isend) return before transmission is
complete and so need the bits to remain untouched until transmission
completes.  If a preserve a reference to the raw vector in R code that
will prevent it from being garbage collected, but if it gets moved
that would invalidate the transfer.

I was just using the blocking sends to avoid this problem, but the
result is significant delays.

Thanks.
Ross Boylan



[Rd] Does R ever move objecsts in memory?
Ross Boylan