wrap all allocs of HParser in helper h_new_parser
This commit is contained in:
parent
3dfc313118
commit
88091b602f
23 changed files with 44 additions and 113 deletions
|
|
@ -59,11 +59,8 @@ const HParser* h_attr_bool(const HParser* p, HPredicate pred) {
|
|||
return h_attr_bool__m(&system_allocator, p, pred);
|
||||
}
|
||||
const HParser* h_attr_bool__m(HAllocator* mm__, const HParser* p, HPredicate pred) {
|
||||
HParser *res = h_new(HParser, 1);
|
||||
res->vtable = &attr_bool_vt;
|
||||
HAttrBool *env = h_new(HAttrBool, 1);
|
||||
env->p = p;
|
||||
env->pred = pred;
|
||||
res->env = (void*)env;
|
||||
return res;
|
||||
return h_new_parser(mm__, &attr_bool_vt, env);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue