From: Jérémie Astor Date: Thu, 5 May 2022 15:03:29 +0000 (+0200) Subject: remove closure.c X-Git-Tag: nightly~274 X-Git-Url: http://10.10.0.4:5575/?a=commitdiff_plain;h=7163cff071e92fa25b39353400f9426225bb345a;p=gwion.git remove closure.c --- diff --git a/src/vm/closure.c b/src/vm/closure.c deleted file mode 100644 index 910e6331..00000000 --- a/src/vm/closure.c +++ /dev/null @@ -1,27 +0,0 @@ -#include "gwion_util.h" -#include "gwion_ast.h" -#include "gwion_env.h" -#include "vm.h" -#include "instr.h" -#include "memoize.h" -#include "gwion.h" -#include "object.h" -#include "array.h" -#include "operator.h" -#include "import.h" - -ANN Closure *new_closure(MemPool mp, const m_uint sz) { - Closure *a = mp_malloc2(mp, sizeof(Closure) + sz); - map_init(&a->m); - a->sz = sz; - return a; -} - -ANN void free_closure(Closure *a, const Gwion gwion) { - const Map m = &a->m; - for (m_uint i = 0; i < map_size(m); ++i) - compound_release(gwion->vm->cleaner_shred, (Type)VKEY(m, i), - a->data + VVAL(m, i)); - map_release(m); - _mp_free(gwion->mp, sizeof(Closure) + a->sz, a); -}