From a5c8d5403ea1f6d10e66655d003f1682903bbd87 Mon Sep 17 00:00:00 2001 From: Travers Date: Fri, 27 Sep 2024 21:29:16 -0700 Subject: [PATCH] update for new RApiSerialize --- ChangeLog | 3 +++ DESCRIPTION | 8 ++++---- R/zzz.R | 2 +- man/qs-package.Rd | 4 ++-- src/qs_deserialize_common.h | 4 ++-- src/qs_serialize_common.h | 2 +- 6 files changed, 13 insertions(+), 10 deletions(-) diff --git a/ChangeLog b/ChangeLog index c17b17d..112b299 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,6 @@ +Version 0.27.2 (2024-09-27) + * Use `STRING_PTR_RO` instead of `STRING_PTR` + Version 0.27.1 (2024-06-04) * Add function `set_trust_promises` to allow for serialization and deserialization of PROMSXP diff --git a/DESCRIPTION b/DESCRIPTION index 9e82fba..4aec282 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,8 +1,8 @@ Package: qs Type: Package Title: Quick Serialization of R Objects -Version: 0.26.4 -Date: 2024-09-25 +Version: 0.27.2 +Date: 2024-09-27 Authors@R: c( person("Travers", "Ching", email = "traversc@gmail.com", role = c("aut", "cre", "cph")), person("Yann", "Collet", role = c("ctb", "cph"), comment = "Yann Collet is the author of the bundled zstd, lz4 and xxHash code"), @@ -21,11 +21,11 @@ LazyData: true Biarch: true Depends: R (>= 3.0.2) Imports: - Rcpp, RApiSerialize (>= 0.1.1), stringfish (>= 0.15.1) + Rcpp, RApiSerialize (>= 0.1.3.1), stringfish (>= 0.15.1) LinkingTo: Rcpp, RApiSerialize, stringfish, BH Encoding: UTF-8 Roxygen: list(markdown = TRUE) -RoxygenNote: 7.3.1 +RoxygenNote: 7.3.2 Suggests: knitr, rmarkdown, testthat, dplyr, data.table VignetteBuilder: knitr Copyright: This package includes code from the 'zstd' library owned by Facebook, Inc. and created by Yann Collet; the 'lz4' library created and owned by Yann Collet; xxHash library created and owned by Yann Collet; and code derived from the 'Blosc' library created and owned by Francesc Alted. diff --git a/R/zzz.R b/R/zzz.R index c6f21c1..54c0248 100644 --- a/R/zzz.R +++ b/R/zzz.R @@ -1,3 +1,3 @@ .onAttach <- function(libname, pkgname) { - packageStartupMessage("qs ", utils::packageVersion("qs")) + packageStartupMessage("qs ", utils::packageVersion("qs"), ". Announcement: https://github.com/qsbase/qs/issues/103") } diff --git a/man/qs-package.Rd b/man/qs-package.Rd index ff62b14..c4fa5be 100644 --- a/man/qs-package.Rd +++ b/man/qs-package.Rd @@ -11,8 +11,8 @@ Provides functions for quickly writing and reading any R object to and from disk \seealso{ Useful links: \itemize{ - \item \url{https://github.com/traversc/qs} - \item Report bugs at \url{https://github.com/traversc/qs/issues} + \item \url{https://github.com/qsbase/qs} + \item Report bugs at \url{https://github.com/qsbase/qs/issues} } } diff --git a/src/qs_deserialize_common.h b/src/qs_deserialize_common.h index 12deaa3..b642065 100644 --- a/src/qs_deserialize_common.h +++ b/src/qs_deserialize_common.h @@ -607,7 +607,7 @@ SEXP processBlock(T * const sobj) { { SEXP obj_data = PROTECT(Rf_allocVector(RAWSXP, r_array_len)); pt++; sobj->getBlockData(reinterpret_cast(RAW(obj_data)), r_array_len); - obj = PROTECT(unserializeFromRaw(obj_data)); pt++; + obj = PROTECT(R::unserializeFromRaw(obj_data)); pt++; return obj; } default: // also NILSXP @@ -791,7 +791,7 @@ SEXP processAttributes(T * const sobj, const bool get_attr = true) { // R-serialized object, rather than the qs object SEXP obj_data = PROTECT(Rf_allocVector(RAWSXP, r_array_len)); pt++; sobj->getBlockData(reinterpret_cast(RAW(obj_data)), r_array_len); - SEXP obj = unserializeFromRaw(obj_data); // no need to PROTECT, ATTRIB doesn't allocate + SEXP obj = R::unserializeFromRaw(obj_data); // no need to PROTECT, ATTRIB doesn't allocate return Rf_PairToVectorList(ATTRIB(obj)); // pairlist, needs to be converted to a regular list } default: // also NILSXP diff --git a/src/qs_serialize_common.h b/src/qs_serialize_common.h index 873b9e5..8d707cd 100644 --- a/src/qs_serialize_common.h +++ b/src/qs_serialize_common.h @@ -409,7 +409,7 @@ void writeObject(T * const sobj, SEXP x) { return; } else if( altrep_registry.find(std::make_pair(classname, pkgname)) != altrep_registry.end() ) { Protect_Tracker pt = Protect_Tracker(); - SEXP xserialized = PROTECT(serializeToRaw(x,Rf_ScalarInteger(3))); pt++; + SEXP xserialized = PROTECT(R::serializeToRaw(x,Rf_ScalarInteger(3))); pt++; uint64_t xs_size = Rf_xlength(xserialized); writeHeader_common(qstype::RSERIALIZED, xs_size, sobj); sobj->push_contiguous(reinterpret_cast(RAW(xserialized)), xs_size);