Gwion coverage report


Directory: src/
File: src/env/trait.c
Date: 2023-01-30 18:32:28
Exec Total Coverage
Lines: 0 8 0.0%
Functions: 0 2 0.0%
Branches: 0 4 0.0%

Line Branch Exec Source
1 #include <gwion_util.h>
2 #include <gwion_ast.h>
3 #include <gwion_env.h>
4
5 ANN Trait new_trait(MemPool mp, const loc_t loc) {
6 const Trait a = mp_calloc(mp, Trait);
7 a->loc = loc;
8 return a;
9 }
10
11 ANN void free_trait(MemPool mp, Trait a) {
12 if (a->var) free_mp_vector(mp, Value, a->var);
13 if (a->fun) free_mp_vector(mp, Func_Def, a->fun);
14 mp_free(mp, Trait, a);
15 }
16