From: fennecdjay <fennecdjay@gmail.com>
Date: Fri, 28 Oct 2022 03:15:31 +0000 (+0200)
Subject: :art: remove vector_realloc call in the compiler
X-Git-Tag: nightly~215^2~109
X-Git-Url: http://10.11.0.4:5575/?a=commitdiff_plain;h=eed4ca8c78f98c6a4d29e5c75171be39812bd567;p=gwion.git

:art: remove vector_realloc call in the compiler
---

diff --git a/src/emit/emit.c b/src/emit/emit.c
index ae359900..cd116501 100644
--- a/src/emit/emit.c
+++ b/src/emit/emit.c
@@ -184,7 +184,6 @@ ANN static m_bool emit_defers(const Emitter emit) {
     if(s) CHECK_BB(emit_stmt(emit, s));
   }
   VLEN(v) = i;
-  vector_realloc(v);
   return GW_OK;
 }
 
@@ -2121,7 +2120,6 @@ ANN static void set_pcs(const Vector v, const m_uint pc) {
     instr->m_val = pc;
   }
   VLEN(v) = i - 1;
-  vector_realloc(v);
 }
 
 ANN static void emit_pop_stack(const Emitter emit, const m_uint index) {
diff --git a/src/parse/check.c b/src/parse/check.c
index 2927616e..7e576f07 100644
--- a/src/parse/check.c
+++ b/src/parse/check.c
@@ -596,7 +596,6 @@ ANN m_bool check_traverse_fdef(const Env env, const Func_Def fdef) {
   Vector w = (Vector)&env->curr->info->value->ptr;
   m_uint i = vector_size(w);
   while (i-- > 1) vector_add(&v, vector_at(w, i));
-  vector_realloc(w);
   const m_bool ret = traverse_func_def(env, fdef);
   for (m_uint i = vector_size(&v) + 1; --i;)
     vector_add((Vector)&env->curr->info->value->ptr, vector_at(&v, i - 1));