You may be over-complicating this. Taking mcmc_new in src/lm_lcmc.c
from https://github.com/merliseclyde/BAS, to minimize code changes I
would arrange the memory management along these lines:
SEXP mcmc_new(...)
{
/* ... */
/* create and protect ANS */
SEXP ANS = PROTECT(allocVector(V
On Wed, 15 Jan 2025, Iris Simmons wrote:
I don't think memcpy works well for VECSXP. The elements being overwritten
need to have their reference counts decreased and the new elements need to
have theirs increased.
You do not want to use memcpy or inanyother way try to write to the
locations in