summaryrefslogtreecommitdiffhomepage
path: root/src/parse.y
diff options
context:
space:
mode:
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"