Replaced glib memory allocation
This commit is contained in:
parent
6101b8c43a
commit
d5729efa1f
33 changed files with 414 additions and 166 deletions
|
|
@ -38,10 +38,13 @@ static HParserVtable difference_vt = {
|
|||
.parse = parse_difference,
|
||||
};
|
||||
|
||||
const HParser* h_difference(const HParser* p1, const HParser* p2) {
|
||||
HTwoParsers *env = g_new(HTwoParsers, 1);
|
||||
const HParser* h_difference(const HParser* p1, const HParser* p2) {
|
||||
return h_difference__m(&system_allocator, p1, p2);
|
||||
}
|
||||
const HParser* h_difference__m(HAllocator* mm__, const HParser* p1, const HParser* p2) {
|
||||
HTwoParsers *env = h_new(HTwoParsers, 1);
|
||||
env->p1 = p1; env->p2 = p2;
|
||||
HParser *ret = g_new(HParser, 1);
|
||||
HParser *ret = h_new(HParser, 1);
|
||||
ret->vtable = &difference_vt; ret->env = (void*)env;
|
||||
return ret;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue