Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/data.table.h
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,7 @@ SEXP memcpyDT(SEXP dest, SEXP src, SEXP offset, SEXP size);
SEXP memcpyVectoradaptive(SEXP dest, SEXP src, SEXP offset, SEXP size);
SEXP memcpyDTadaptive(SEXP dest, SEXP src, SEXP offset, SEXP size);
SEXP copyAsGrowable(SEXP x);
SEXP resizeVector(SEXP x, SEXP size);

// nafill.c
void nafillDouble(double *x, uint_fast64_t nx, unsigned int type, double fill, bool nan_is_na, ans_t *ans, bool verbose);
Expand Down
6 changes: 6 additions & 0 deletions src/frollapply.c
Original file line number Diff line number Diff line change
Expand Up @@ -87,3 +87,9 @@ SEXP copyAsGrowable(SEXP x) {
UNPROTECT(1);
return ret;
}

SEXP resizeVector(SEXP x, SEXP size) {
R_xlen_t newlen = INTEGER_RO(size)[0];

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need some input validation for size or newlen

.Call(CresizeVector, x, -1L)
# Warning message:
# printing of extremely long output is truncated
.Call(CresizeVector, x, NA_integer_)
# Warning message:
# printing of extremely long output is truncated

are problematic

R_resizeVector(x, newlen);
return x;
}
1 change: 1 addition & 0 deletions src/init.c
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,7 @@ static const R_CallMethodDef callMethods[] = {
{"CmemcpyVectoradaptive", (DL_FUNC)&memcpyVectoradaptive, -1},
{"CmemcpyDTadaptive", (DL_FUNC)&memcpyDTadaptive, -1},
{"CcopyAsGrowable", (DL_FUNC)&copyAsGrowable, -1},
{"CresizeVector", (DL_FUNC)&resizeVector, -1},
{"Cfrolladapt", (DL_FUNC)&frolladapt, -1},
{"Cis_direct_child", (DL_FUNC)&is_direct_child, -1},
{NULL, NULL, 0}};
Expand Down
Loading