Skip to content

Commit ba8a7a7

Browse files
aitapben-schwen
andcommitted
Detect --max-ppsize
Co-Authored-By: Benjamin Schwendinger <52290390+ben-schwen@users.noreply.github.com>
1 parent 89b3b5d commit ba8a7a7

1 file changed

Lines changed: 10 additions & 2 deletions

File tree

inst/tests/tests.Rraw

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21672,6 +21672,14 @@ test(2375.6, print(data.table(x=rep("ABCDEFGHIJKLMNOPQRSTUVWXYZ", 1e6)), topn=1)
2167221672

2167321673
# rbindlist() used to put O(ncol(...)) > R_PPStackSize items on the protect stack, #7793
2167421674
# Assuming 50000 as the default protection stack size, although R --max-ppsize=... can increase it to 500000.
21675-
x = as.data.table(as.list(1:50001))
21675+
max_ppsize = local({
21676+
arg = grep("^--max-ppsize=", commandArgs(FALSE), value = TRUE)
21677+
if (length(arg)) {
21678+
v = suppressWarnings(as.integer(sub("^--max-ppsize=", "", tail(arg, 1L))))
21679+
if (!is.na(v)) return(v)
21680+
}
21681+
50000L
21682+
})
21683+
x = as.data.table(as.list(1:max_ppsize))
2167621684
test(2376, rbindlist(list(x)), x)
21677-
rm(x)
21685+
rm(x, max_ppsize)

0 commit comments

Comments
 (0)