Skip to content

Commit 2d187ff

Browse files
santigimenotrevnorris
authored andcommitted
src: change EnvList::promise_tracking_() signature
Pass directly the SharedEnvInst. PR-URL: #25 Reviewed-by: Trevor Norris <trev.norris@gmail.com>
1 parent 797d115 commit 2d187ff

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

src/nsolid/nsolid_api.cc

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1557,8 +1557,7 @@ void EnvList::gen_ptiles_cb_(ns_timer*) {
15571557
}
15581558

15591559

1560-
void EnvList::promise_tracking_(const EnvInst& envinst, bool track) {
1561-
SharedEnvInst envinst_sp = EnvInst::GetInst(envinst.thread_id());
1560+
void EnvList::promise_tracking_(SharedEnvInst envinst_sp, bool track) {
15621561
Environment* env = envinst_sp->env();
15631562
if (env->nsolid_track_promises_fn().IsEmpty() ||
15641563
!envinst_sp->can_call_into_js()) {
@@ -1581,12 +1580,12 @@ void EnvList::promise_tracking_(const EnvInst& envinst, bool track) {
15811580

15821581

15831582
void EnvList::enable_promise_tracking_(SharedEnvInst envinst_sp, void*) {
1584-
EnvList::promise_tracking_(*envinst_sp.get(), true);
1583+
EnvList::promise_tracking_(envinst_sp, true);
15851584
}
15861585

15871586

15881587
void EnvList::disable_promise_tracking_(SharedEnvInst envinst_sp, void*) {
1589-
EnvList::promise_tracking_(*envinst_sp.get(), false);
1588+
EnvList::promise_tracking_(envinst_sp, false);
15901589
}
15911590

15921591

src/nsolid/nsolid_api.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -594,7 +594,7 @@ class EnvList {
594594
static void blocked_loop_timer_cb_(nsuv::ns_timer*);
595595
static void gen_ptiles_cb_(nsuv::ns_timer*);
596596
static void raw_metrics_timer_cb_(nsuv::ns_timer*);
597-
static void promise_tracking_(const EnvInst& envinst, bool track);
597+
static void promise_tracking_(SharedEnvInst envinst_sp, bool track);
598598
static void enable_promise_tracking_(SharedEnvInst envinst_sp, void*);
599599
static void disable_promise_tracking_(SharedEnvInst envinst_sp, void*);
600600
static void update_has_metrics_stream_hooks(SharedEnvInst, bool has_metrics);

0 commit comments

Comments
 (0)