Skip to content

Commit

Permalink
src: change EnvList::promise_tracking_() signature
Browse files Browse the repository at this point in the history
Pass directly the SharedEnvInst.

PR-URL: #25
Reviewed-by: Trevor Norris <[email protected]>
  • Loading branch information
santigimeno authored and trevnorris committed Nov 30, 2023
1 parent 6eb5d34 commit 33c8b29
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
7 changes: 3 additions & 4 deletions src/nsolid/nsolid_api.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1556,8 +1556,7 @@ void EnvList::gen_ptiles_cb_(ns_timer*) {
}


void EnvList::promise_tracking_(const EnvInst& envinst, bool track) {
SharedEnvInst envinst_sp = EnvInst::GetInst(envinst.thread_id());
void EnvList::promise_tracking_(SharedEnvInst envinst_sp, bool track) {
Environment* env = envinst_sp->env();
if (env->nsolid_track_promises_fn().IsEmpty() ||
!envinst_sp->can_call_into_js()) {
Expand All @@ -1580,12 +1579,12 @@ void EnvList::promise_tracking_(const EnvInst& envinst, bool track) {


void EnvList::enable_promise_tracking_(SharedEnvInst envinst_sp, void*) {
EnvList::promise_tracking_(*envinst_sp.get(), true);
EnvList::promise_tracking_(envinst_sp, true);
}


void EnvList::disable_promise_tracking_(SharedEnvInst envinst_sp, void*) {
EnvList::promise_tracking_(*envinst_sp.get(), false);
EnvList::promise_tracking_(envinst_sp, false);
}


Expand Down
2 changes: 1 addition & 1 deletion src/nsolid/nsolid_api.h
Original file line number Diff line number Diff line change
Expand Up @@ -594,7 +594,7 @@ class EnvList {
static void blocked_loop_timer_cb_(nsuv::ns_timer*);
static void gen_ptiles_cb_(nsuv::ns_timer*);
static void raw_metrics_timer_cb_(nsuv::ns_timer*);
static void promise_tracking_(const EnvInst& envinst, bool track);
static void promise_tracking_(SharedEnvInst envinst_sp, bool track);
static void enable_promise_tracking_(SharedEnvInst envinst_sp, void*);
static void disable_promise_tracking_(SharedEnvInst envinst_sp, void*);
static void update_has_metrics_stream_hooks(SharedEnvInst, bool has_metrics);
Expand Down

0 comments on commit 33c8b29

Please sign in to comment.