Skip to content

Commit 2370719

Browse files
committed
improve comments
1 parent c4298cc commit 2370719

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

R/frollapply.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,7 @@ frollapply = function(X, N, FUN, ..., by.column=TRUE, fill=NA, align=c("right","
295295
setDTthreads(1L) ## disable nested parallelism
296296
lapply(ii[[th]], ## loops over indexes for that thread
297297
FUN = tight, ## handles adaptive and by.column
298-
dest = cpy(w), ## allocate own window for each thread
298+
dest = cpy(w), ## allocate own window for each thread, if we would not copy here, then copy would be handled later on by fork's copy-on-write
299299
src = thisx, ## full input
300300
n = thisn) ## scalar or in adaptive case a vector
301301
# nocov end

src/frollapply.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ SEXP memcpyDTadaptive(SEXP dest, SEXP src, SEXP offset, SEXP size) {
8585
SEXP setgrowable(SEXP x) {
8686
if (!isNewList(x)) {
8787
SET_GROWABLE_BIT(x);
88-
SET_TRUELENGTH(x, LENGTH(x)); // we just reset length, doesn't seems to be necessary but for future compatibility to R it is more safe to set it up
88+
SET_TRUELENGTH(x, LENGTH(x)); // important because gc() uses TRUELENGTH to keep counts
8989
} else {
9090
// # 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
9191
for (int i=0; i<LENGTH(x); ++i) {

0 commit comments

Comments
 (0)