Skip to content

Commit

Permalink
use RObject to manage gc (#324)
Browse files Browse the repository at this point in the history
  • Loading branch information
mschubert committed Dec 26, 2023
1 parent 16eb03b commit 8bba409
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion R/pool.r
Original file line number Diff line number Diff line change
Expand Up @@ -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")

Expand Down
6 changes: 3 additions & 3 deletions src/CMQMaster.h
Original file line number Diff line number Diff line change
Expand Up @@ -265,9 +265,9 @@ class CMQMaster {
private:
struct worker_t {
std::set<std::string> 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};
Expand Down

0 comments on commit 8bba409

Please sign in to comment.