Skip to content

Commit

Permalink
update for new RApiSerialize
Browse files Browse the repository at this point in the history
  • Loading branch information
traversc committed Sep 28, 2024
1 parent 3f244d5 commit a5c8d54
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 10 deletions.
3 changes: 3 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -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

Expand Down
8 changes: 4 additions & 4 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -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 = "[email protected]", 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"),
Expand All @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion R/zzz.R
Original file line number Diff line number Diff line change
@@ -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")
}
4 changes: 2 additions & 2 deletions man/qs-package.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions src/qs_deserialize_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -607,7 +607,7 @@ SEXP processBlock(T * const sobj) {
{
SEXP obj_data = PROTECT(Rf_allocVector(RAWSXP, r_array_len)); pt++;
sobj->getBlockData(reinterpret_cast<char*>(RAW(obj_data)), r_array_len);
obj = PROTECT(unserializeFromRaw(obj_data)); pt++;
obj = PROTECT(R::unserializeFromRaw(obj_data)); pt++;
return obj;
}
default: // also NILSXP
Expand Down Expand Up @@ -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<char*>(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
Expand Down
2 changes: 1 addition & 1 deletion src/qs_serialize_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -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<char*>(RAW(xserialized)), xs_size);
Expand Down

0 comments on commit a5c8d54

Please sign in to comment.