You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* upgraded MEMCPY from macro to function
Also:
formatting improvements
inlining of temporary objects
constness improvements (both qualifiers and API functions)
* make static inline, add codecov
* codecov does not work well from parallel, use 1 th
---------
Co-authored-by: Jan Gorecki <[email protected]>
default: internal_error(__func__, "column type not supported in memcpyVector or memcpyDT function. All known types are supported so please report as bug."); \
default: internal_error(__func__, "column type not supported in memcpyVector or memcpyDT function. All known types are supported so please report as bug."); // # nocov
27
+
}
28
+
}
30
29
31
30
/*
32
31
* memcpy src data into preallocated window
33
32
* we don't call memcpyVector from memcpyDT because they are called in tight loop and we don't want to have extra branches inside
// # nocov start ## does not seem to be reported to codecov most likely due to running in a fork, I manually debugged that it is being called when running froll.Rraw
size_to=oi-nrow; // oi should always be bigger than nrow because we filter out incomplete window using ansMask
61
-
SEXPd=dest, s=src;
62
-
SETLENGTH(d, nrow); // must be before MEMCPY because attempt to set index 1/1 in SET_STRING_ELT test 6010.150
51
+
constsize_toi=INTEGER_RO(offset)[0];
52
+
constintnrow=INTEGER_RO(size)[oi-1];
53
+
constsize_to=oi-nrow; // oi should always be bigger than nrow because we filter out incomplete window using ansMask
54
+
SETLENGTH(dest, nrow); // must be before MEMCPY_SEXP because attempt to set index 1/1 in SET_STRING_ELT test 6010.150
63
55
if (nrow) { // support k[i]==0
64
-
MEMCPY
56
+
MEMCPY_SEXP(dest, o, src, nrow);
65
57
}
66
58
returndest;
67
59
}
68
60
// # nocov start ## does not seem to be reported to codecov most likely due to running in a fork, I manually debugged that it is being called when running froll.Rraw
//Rprintf("%d",2); // manual code coverage to confirm it is reached when marking nocov
71
-
size_toi=INTEGER(offset)[0];
72
-
intnrow=INTEGER(size)[oi-1];
73
-
size_to=oi-nrow;
74
-
intncol=LENGTH(dest);
75
-
SEXPd, s;
76
-
for (intj=0; j<ncol; ++j) {
77
-
d=VECTOR_ELT(dest, j);
78
-
s=VECTOR_ELT(src, j);
63
+
size_toi=INTEGER_RO(offset)[0];
64
+
constintnrow=INTEGER_RO(size)[oi-1];
65
+
constsize_to=oi-nrow;
66
+
constintncol=LENGTH(dest);
67
+
for (inti=0; i<ncol; i++) {
68
+
SEXPd=VECTOR_ELT(dest, i);
79
69
SETLENGTH(d, nrow);
80
70
if (nrow) { // support k[i]==0
81
-
MEMCPY
71
+
MEMCPY_SEXP(d, o, VECTOR_ELT(src, i), nrow);
82
72
}
83
73
}
84
74
returndest;
@@ -92,7 +82,7 @@ SEXP setgrowable(SEXP x) {
92
82
SET_TRUELENGTH(x, LENGTH(x)); // important because gc() uses TRUELENGTH to keep counts
93
83
} else {
94
84
// # nocov start ## does not seem to be reported to codecov most likely due to running in a fork, I manually debugged that it is being called when running froll.Rraw
95
-
for (inti=0; i<LENGTH(x); ++i) {
85
+
for (inti=0; i<LENGTH(x); i++) {
96
86
//Rprintf("%d",3); // manual code coverage to confirm it is reached when marking nocov
0 commit comments