Change memory allocation API to require size for free and realloc.

This commit is contained in:
Damien
2013-12-29 19:33:23 +00:00
parent a1c8e5737c
commit 732407f1bf
22 changed files with 57 additions and 52 deletions

View File

@@ -94,8 +94,8 @@ typedef struct _parser_t {
static void push_rule(parser_t *parser, const rule_t *rule, int arg_i) {
if (parser->rule_stack_top >= parser->rule_stack_alloc) {
parser->rule_stack = m_renew(rule_stack_t, parser->rule_stack, parser->rule_stack_alloc, parser->rule_stack_alloc * 2);
parser->rule_stack_alloc *= 2;
parser->rule_stack = m_renew(rule_stack_t, parser->rule_stack, parser->rule_stack_alloc);
}
parser->rule_stack[parser->rule_stack_top].rule_id = rule->rule_id;
parser->rule_stack[parser->rule_stack_top].arg_i = arg_i;