Skip to content

Commit ab5c1ce

Browse files
author
luke
committed
Improved backports for resizable API from Ivan Krylov.
git-svn-id: https://svn.r-project.org/R/trunk@89097 00db46b3-68df-0310-9c12-caf00c1e9a41
1 parent d2f096f commit ab5c1ce

File tree

1 file changed

+17
-3
lines changed

1 file changed

+17
-3
lines changed

doc/manual/R-exts.texi

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17818,9 +17818,23 @@ void CLEAR_ATTRIB(SEXP x)
1781817818
#if R_VERSION < R_Version(4, 6, 0)
1781917819
# define DATAPTR_RW(x) DATAPTR(x)
1782017820
# define R_class(x) R_data_class(x, FALSE)
17821-
# define R_allocResizableVector(type, maxlen) Rf_allocVector(type, naxlen)
17822-
# define R_duplicateAsResizable(x) duplicate(x)
17823-
# define R_resizeVector(x, newlen) SETLENGTH(x, n)
17821+
# define R_resizeVector(x, newlen) SETLENGTH(x, newlen)
17822+
17823+
SEXP R_allocResizableVector(SEXPTYPE type, R_xlen_t maxlen)
17824+
@{
17825+
SEXP ret = Rf_allocVector(type, maxlen);
17826+
SET_TRUELENGTH(ret, maxlen);
17827+
SET_GROWABLE_BIT(ret);
17828+
return ret;
17829+
@}
17830+
17831+
SEXP R_duplicateAsResizable(SEXP x)
17832+
@{
17833+
SEXP ret = Rf_duplicate(x);
17834+
SET_TRUELENGTH(ret, Rf_xlength(x));
17835+
SET_GROWABLE_BIT(ret);
17836+
return ret;
17837+
@}
1782417838
#endif
1782517839
@end example
1782617840

0 commit comments

Comments
 (0)