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 <trev.norris@gmail.com>
  • Loading branch information
santigimeno authored and trevnorris committed Dec 7, 2023
1 parent 797d115 commit 2d187ff
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 @@ -1557,8 +1557,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 @@ -1581,12 +1580,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 2d187ff

Please sign in to comment.