search for: duplicate_atomic_vector

Displaying 2 results from an estimated 2 matches for "duplicate_atomic_vector".

2010 Apr 21
2
suggestion how to use memcpy in duplicate.c
...at be replaced with : case INTSXP: for (i=0; i<ns/nt; i++) memcpy((char *)DATAPTR(s)+i*nt*sizeof(int), (char *)DATAPTR(t), nt*sizeof(int)); break; and similar for the other types in copyVector. This won't help regular vector copies, since those seem to be done by the DUPLICATE_ATOMIC_VECTOR macro, see next suggestion below, but it should help copyMatrix which calls copyVector, scan.c which calls copyVector on three lines, dcf.c (once) and dounzip.c (once). For the DUPLICATE_ATOMIC_VECTOR macro there is already a comment next to it : <FIXME>: surely memcpy would be fast...
2010 Mar 07
1
duplicate STRSXP : shallow copy ?
...quot;, "Tack", "Tock" ) ) [[1]] [1] "tick" "tack" "tock" [[2]] [1] "tick" "tack" "tock" where I would expect the second element of the list to not be modified. Is this intended ? If not, I can track it down to the DUPLICATE_ATOMIC_VECTOR in duplicate.c and submit a patch. Also, CHARSXP don't seem to be actually duplicated : case CHARSXP: return s; Romain -- Romain Francois Professional R Enthusiast +33(0) 6 28 91 30 30 http://romainfrancois.blog.free.fr |- http://tr.im/OIXN : raster images and RImageJ |- http://tr.i...