Skip to content

Commit

Permalink
Test fixes valgrind
Browse files Browse the repository at this point in the history
  • Loading branch information
andrjohns committed Jul 17, 2024
1 parent 7015761 commit 945f1d3
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/R-CMD-check-cross.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
on:
push:
branches: [main, master]
pull_request:
branches: [main, master]
#pull_request:
#branches: [main, master]

name: R-CMD-check-crossplatform

Expand Down
5 changes: 2 additions & 3 deletions inst/include/quickjsr/JS_Containers.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,14 @@ struct JS_RtCtxContainer {
}
};


using RtCtxXPtr = cpp11::external_pointer<JS_RtCtxContainer>;

template <typename JSValT>
struct JS_ValContainer {
public:
RtCtxXPtr rt_ctx;
JSValT val;
JSValue val;

template <typename JSValT>
JS_ValContainer(RtCtxXPtr in_rt_ctx, JSValT&& in_val)
: rt_ctx(in_rt_ctx), val(std::forward<JSValT>(in_val)) {}

Expand Down
3 changes: 2 additions & 1 deletion src/quickjsr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ extern "C" {
BEGIN_CPP11
int stack_size = Rf_isInteger(stack_size_) ? INTEGER_ELT(stack_size_, 0)
: static_cast<int>(REAL_ELT(stack_size_, 0));
return RtCtxXPtr(new JS_RtCtxContainer(stack_size));
RtCtxXPtr rt(new JS_RtCtxContainer(stack_size));
return cpp11::as_sexp(rt);
END_CPP11
}

Expand Down

0 comments on commit 945f1d3

Please sign in to comment.