The R Project SVN R

Rev

Rev 60943 | Rev 64724 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 60943 Rev 61272
Line 39... Line 39...
39
 *  the value duplicated.  */
39
 *  the value duplicated.  */
40
 
40
 
41
/* This macro pulls out the common code in copying an atomic vector.
41
/* This macro pulls out the common code in copying an atomic vector.
42
   The special handling of the scalar case (__n__ == 1) seems to make
42
   The special handling of the scalar case (__n__ == 1) seems to make
43
   a small but measurable difference, at least for some cases
43
   a small but measurable difference, at least for some cases
44
   and when (as prior to 2.16.0) a for() loop was used.
44
   and when (as in R 2.15.x) a for() loop was used.
45
*/
45
*/
46
#define DUPLICATE_ATOMIC_VECTOR(type, fun, to, from) do { \
46
#define DUPLICATE_ATOMIC_VECTOR(type, fun, to, from) do { \
47
  R_xlen_t __n__ = XLENGTH(from); \
47
  R_xlen_t __n__ = XLENGTH(from); \
48
  PROTECT(from); \
48
  PROTECT(from); \
49
  PROTECT(to = allocVector(TYPEOF(from), __n__)); \
49
  PROTECT(to = allocVector(TYPEOF(from), __n__)); \