use mrb's allocator; thanks to @mitchblank

This commit is contained in:
Yukihiro Matsumoto
2012-05-21 17:11:38 +09:00
parent 21bd5d7924
commit 1dbfc39997
+6
View File
@@ -10,6 +10,12 @@
#define YYDEBUG 1
#define YYERROR_VERBOSE 1
/*
* Force yacc to use our memory management. This is a little evil because
* the macros assume that "parser_state *p" is in scope
*/
#define YYMALLOC(n) mrb_malloc(p->mrb, (n))
#define YYFREE(o) mrb_free(p->mrb, (o))
#define YYSTACK_USE_ALLOCA 0
#include "mruby.h"