wrap all allocs of HParser in helper h_new_parser

This commit is contained in:
Sven M. Hallberg 2013-04-27 04:17:47 +02:00
parent 3dfc313118
commit 88091b602f
23 changed files with 44 additions and 113 deletions

View file

@ -60,8 +60,5 @@ const HParser* h_whitespace(const HParser* p) {
return h_whitespace__m(&system_allocator, p);
}
const HParser* h_whitespace__m(HAllocator* mm__, const HParser* p) {
HParser *ret = h_new(HParser, 1);
ret->vtable = &whitespace_vt;
ret->env = (void*)p;
return ret;
return h_new_parser(mm__, &whitespace_vt, (void *)p);
}