Skip to content

Commit

Permalink
Also fixup debug comments
Browse files Browse the repository at this point in the history
  • Loading branch information
DavisVaughan committed Dec 1, 2023
1 parent 57fef8f commit 19b0970
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions inst/include/cpp11/sexp.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,15 @@ class sexp {
sexp() = default;

sexp(SEXP data) : data_(data), preserve_token_(preserved.insert(data_)) {
// REprintf("created %x %x : %i\n", data_, preserve_token_, protect_head_size());
// REprintf("created %p %p\n", reinterpret_cast<void*>(data_),
// reinterpret_cast<void*>(preserve_token_));
}

sexp(const sexp& rhs) {
data_ = rhs.data_;
preserve_token_ = preserved.insert(data_);
// REprintf("copied %x new protect %x : %i\n", rhs.data_, preserve_token_,
// protect_head_size());
// REprintf("copied %p new protect %p\n", reinterpret_cast<void*>(rhs.data_),
// reinterpret_cast<void*>(preserve_token_));
}

sexp(sexp&& rhs) {
Expand All @@ -37,15 +38,15 @@ class sexp {
rhs.data_ = R_NilValue;
rhs.preserve_token_ = R_NilValue;

// REprintf("moved %x : %i\n", rhs.data_, protect_head_size());
// REprintf("moved %p\n", reinterpret_cast<void*>(rhs.data_));
}

sexp& operator=(const sexp& rhs) {
preserved.release(preserve_token_);

data_ = rhs.data_;
preserve_token_ = preserved.insert(data_);
// REprintf("assigned %x : %i\n", rhs.data_, protect_head_size());
// REprintf("assigned %p\n", reinterpret_cast<void*>(rhs.data_));
return *this;
}

Expand Down

0 comments on commit 19b0970

Please sign in to comment.