summaryrefslogtreecommitdiffhomepage
path: root/src/parse.y
diff options
context:
space:
mode:
authorYukihiro Matsumoto <[email protected]>2012-05-21 17:11:38 +0900
committerYukihiro Matsumoto <[email protected]>2012-05-21 17:11:38 +0900
commit1dbfc3999753eabaa15b461a23009086ceaa215a (patch)
treedb9622d899ca1b35a1fb349befa2fa86f88b980a /src/parse.y
parent21bd5d792418910978266563a46974412bba8e0b (diff)
downloadmruby-1dbfc3999753eabaa15b461a23009086ceaa215a.tar.gz
mruby-1dbfc3999753eabaa15b461a23009086ceaa215a.zip
use mrb's allocator; thanks to @mitchblank
Diffstat (limited to 'src/parse.y')
-rw-r--r--src/parse.y6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/parse.y b/src/parse.y
index e9348e7a1..871842668 100644
--- a/src/parse.y
+++ b/src/parse.y
@@ -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"