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 |