We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent af91fe9 commit 5caf9ccCopy full SHA for 5caf9cc
src/data.table.h
@@ -92,10 +92,13 @@
92
# define R_allocResizableVector(type, maxlen) R_allocResizableVector_(type, maxlen)
93
# define R_duplicateAsResizable(x) R_duplicateAsResizable_(x)
94
# define R_resizeVector(x, newlen) SETLENGTH(x, newlen)
95
-# define R_maxLength(x) TRUELENGTH(x)
+# define R_maxLength(x) R_maxLength_(x)
96
+ static inline R_xlen_t R_maxLength_(SEXP x) {
97
+ return IS_GROWABLE(x) ? TRUELENGTH(x) : XLENGTH(x);
98
+ }
99
# define R_isResizable(x) R_isResizable_(x)
100
static inline bool R_isResizable_(SEXP x) {
- // IS_GROWABLE also checks for TRUELENGTH < XLENGTH
101
+ // IS_GROWABLE also checks for XLENGTH < TRUELENGTH
102
return (LEVELS(x) & 0x20) && TRUELENGTH(x);
103
}
104
#endif
0 commit comments