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
if (verbose) Rprintf(_("The data.table internal attributes of this table are invalid. This is expected and normal for a data.table loaded from disk. Please remember to always setDT() immediately after loading to prevent unexpected behavior. If this table was not loaded from disk or you've already run setDT(), please report to the data.table issue tracker.\n"));
123
120
return-1;
124
121
}
125
122
if (!isNull(p)) internal_error(__func__, ".internal.selfref ptr is neither NULL nor R_NilValue"); // # nocov
126
-
tag=R_ExternalPtrTag(v);
123
+
SEXPtag=R_ExternalPtrTag(v);
127
124
if (!(isNull(tag) ||isString(tag))) internal_error(__func__, ".internal.selfref tag is neither NULL nor a character vector"); // # nocov
128
-
names=getAttrib(x, R_NamesSymbol);
125
+
SEXPnames=getAttrib(x, R_NamesSymbol);
129
126
if (names!=tag&&isString(names) && !ALTREP(names)) // !ALTREP for #4734
130
127
SET_TRUELENGTH(names, LENGTH(names));
131
128
// R copied this vector not data.table; it's not actually over-allocated. It looks over-allocated
132
129
// because R copies the original vector's tl over despite allocating length.
133
-
prot=R_ExternalPtrProtected(v);
130
+
SEXPprot=R_ExternalPtrProtected(v);
134
131
if (TYPEOF(prot) !=EXTPTRSXP) // Very rare. Was error(_(".internal.selfref prot is not itself an extptr")).
135
132
return0; // # nocov ; see http://stackoverflow.com/questions/15342227/getting-a-random-internal-selfref-error-in-data-table-for-r
// if (TRUELENGTH(getAttrib(dt,R_NamesSymbol))!=tl)
261
256
// internal_error(__func__, "tl of dt passes checks, but tl of names (%d) != tl of dt (%d)", tl, TRUELENGTH(getAttrib(dt,R_NamesSymbol))); // # nocov
262
257
263
-
tl=TRUELENGTH(dt);
258
+
constR_len_ttl=TRUELENGTH(dt);
264
259
// R <= 2.13.2 and we didn't catch uninitialized tl somehow
265
260
if (tl<0) internal_error(__func__, "tl of class is marked but tl<0"); // # nocov
266
261
if (tl>0&&tl<l) internal_error(__func__, "tl (%d) < l (%d) but tl of class is marked", tl, l); // # nocov
267
262
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 to data.table issue tracker including the result of sessionInfo()."),tl,l);
268
263
if (n>tl) return(shallow(dt,R_NilValue,n)); // usual case (increasing alloc)
269
264
if (n<tl&&verbose) Rprintf(_("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);
270
265
// otherwise the finalizer can't clear up the Large Vector heap
0 commit comments