From 8bba409d270c6ceaed2ec2976b4af57f4b7818f4 Mon Sep 17 00:00:00 2001 From: mschubert Date: Tue, 26 Dec 2023 21:06:04 +0100 Subject: [PATCH] use RObject to manage gc (#324) --- R/pool.r | 2 +- src/CMQMaster.h | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/R/pool.r b/R/pool.r index 31edd8f..eb5132a 100644 --- a/R/pool.r +++ b/R/pool.r @@ -102,10 +102,10 @@ Pool = R6::R6Class("Pool", }, cleanup = function(timeout=5) { - info = self$info() success = private$master$close(as.integer(timeout*1000)) success = self$workers$cleanup(success, timeout) # timeout left? + info = self$info() max_mem = max(c(info$mem.max+2e8, 0), na.rm=TRUE) # add 200 Mb max_mem_str = format(structure(max_mem, class="object_size"), units="auto") diff --git a/src/CMQMaster.h b/src/CMQMaster.h index 77a245d..ae1ff28 100644 --- a/src/CMQMaster.h +++ b/src/CMQMaster.h @@ -265,9 +265,9 @@ class CMQMaster { private: struct worker_t { std::set env; - SEXP call {R_NilValue}; - SEXP time {Rcpp::List()}; - SEXP mem {Rcpp::List()}; + Rcpp::RObject call {R_NilValue}; + Rcpp::RObject time {R_NilValue}; + Rcpp::RObject mem {R_NilValue}; wlife_t status; std::string via; int n_calls {-1};