From: fennecdjay Date: Fri, 2 Sep 2022 12:14:36 +0000 (+0200) Subject: :art: Remove add_to_killed X-Git-Tag: nightly~264^2~14 X-Git-Url: http://10.10.0.4:5575/?a=commitdiff_plain;h=2a90837d4a72cf031ededd0fe1206c862f7a3ab1;p=gwion.git :art: Remove add_to_killed --- diff --git a/src/vm/shreduler.c b/src/vm/shreduler.c index bd793d97..beba69e8 100644 --- a/src/vm/shreduler.c +++ b/src/vm/shreduler.c @@ -126,14 +126,12 @@ ANN void shreduler_add(const Shreduler s, const VM_Shred shred) { ANN Shreduler new_shreduler(const MemPool mp) { Shreduler s = (Shreduler)mp_calloc(mp, Shreduler); vector_init(&s->active_shreds); - vector_init(&s->killed_shreds); MUTEX_SETUP(s->mutex); return s; } ANN void free_shreduler(const MemPool mp, const Shreduler s) { vector_release(&s->active_shreds); - vector_release(&s->killed_shreds); MUTEX_CLEANUP(s->mutex); mp_free(mp, Shreduler, s); } diff --git a/src/vm/vm.c b/src/vm/vm.c index a0ab5a89..8fe14bb2 100644 --- a/src/vm/vm.c +++ b/src/vm/vm.c @@ -142,12 +142,6 @@ ANN static inline void shred_trace(const VM_Shred shred, const struct TraceStart trace(shred, vector_size(&shred->info->line)); } -ANN static inline void add_to_killed(const VM_Shred shred) { - const Shreduler shreduler = shred->tick->shreduler; - vector_rem2(&shreduler->active_shreds, (m_uint)shred); - vector_add(&shreduler->killed_shreds, (m_uint)shred); -} - ANN static inline void unhandled_pp(VM_Shred shred, const m_str effect, const struct TraceStart *ts) { gw_err("{-}[{0}{+}Gwion{0}{-}](VM):{0} {-}in code {/+}'%s'{0}{-}. origin: {/+}'%s'{0}{-}\n", ts->code->name, shred->info->orig->name); @@ -159,7 +153,8 @@ ANN static inline void handle_fail(VM_Shred shred, const m_str effect, const str unhandled_pp(shred, effect, ts); if (shred->info->line.ptr) // trace if available shred_trace(shred, ts); - add_to_killed(shred); +// add_to_killed(shred); + shreduler_remove(shred->tick->shreduler, shred, true); } ANN void handle(VM_Shred shred, const m_str effect) {