Skip to content

Commit

Permalink
Warning message in assign.c improved with guidance to use := inside D…
Browse files Browse the repository at this point in the history
…T[...] rather than <- outside.
  • Loading branch information
mattdowle committed Apr 27, 2016
1 parent 9cfb13b commit e4009c7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/assign.c
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ SEXP alloccol(SEXP dt, R_len_t n, Rboolean verbose)
if (tl>0 && tl<l) error("Internal error, please report (including result of sessionInfo()) to datatable-help: tl (%d) < l (%d) but tl of class is marked.", tl, l);
if (tl>l+10000) warning("tl (%d) is greater than 10,000 items over-allocated (l = %d). If you didn't set the datatable.alloccol option to be very large, please report this to datatable-help including the result of sessionInfo().",tl,l);
if (n>tl) return(shallow(dt,R_NilValue,n)); // usual case (increasing alloc)
if (n<tl) warning("Attempt to reduce allocation from %d to %d ignored. Can only increase allocation via shallow copy.",tl,n);
if (n<tl) warning("Attempt to reduce allocation from %d to %d ignored. Can only increase allocation via shallow copy. Please do not use DT[...]<- or DT$someCol<-. Use := inside DT[...] instead.",tl,n);
// otherwise the finalizer can't clear up the Large Vector heap
return(dt);
}
Expand Down

0 comments on commit e4009c7

Please sign in to comment.