aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/parse.cff5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/parse.cff b/src/parse.cff
index 1125f37..e237a90 100644
--- a/src/parse.cff
+++ b/src/parse.cff
@@ -810,7 +810,7 @@ fn parseexpandtepl(P *Parser, tepl *Tepl) *const Type {
let loc = container_of(tepl, Decl, u.Tepl).loc;
while !lexmatch(P, &tok, '>') {
let par = &tepl.params[i];
- let toks [#]Tok = (as(*Tok)xcalloc(sizeof Tok, 1))[0::1];
+ let toks [#]Tok = (as(*Tok)P.alloc->alloc(sizeof Tok, alignof Tok))[0::1];
switch par.u {
case Ty;
toks[0] = { :typearg, P.curloc, parsetype(P), .u: { .ident: par.name }};
@@ -895,6 +895,7 @@ fn parseexpandtepl(P *Parser, tepl *Tepl) *const Type {
}
}
}
+ free(args);
free(tpargs.#ptr);
return cache.ty;
}
@@ -909,7 +910,7 @@ fn parseexpandtepl(P *Parser, tepl *Tepl) *const Type {
}
envfree(env);
(as(*Type)ty).u.Agg.tpargs = tpargs;
- cache = xcalloc(sizeof(*cache), 1);
+ cache = P.alloc->alloc(sizeof(*cache), alignof(*cache));
cache.next = tepl.cache;
cache.args = tpargs;
cache.ty = ty;