The current version of the (lme4)[https://github.com/lme4/lme4] package for (R)[http://www.r-project.org) is based on a rather questionable practice of storing external pointers from C++ objects in an R reference class object. The idea was that when the reference class object was created the corresponding C++ class instance would be created. All changes to this object would be made through the external pointer in the C++ code.
This is risky because any changes to the R objects in the reference class could cause changes in the location of its values, after which all bets are off because the R object and the C++ object are referring to different memory locations.
It turns out that this does happen in the development version of R, which will become R-3.1.0, if the LAZY_DUPLICATE_OK
flag is set. The symptom is that deepcopy
methods are not copying and I suspect this is because the lazy duplication doesn't duplicate before the external pointer is constructed. We were living outsid