mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
Enable YYSTACK_USE_ALLOCA.
It used heap allocated memory for the parser stack, but there's possibility of parser termination by exceptions. In that case, the parser stack memory is leaked. We were afraid of stack consumption, but parser stack size is only 4KB, so we don't have to worry about it (at least for the parser).
This commit is contained in:
@@ -10,13 +10,7 @@
|
||||
# define YYDEBUG 1
|
||||
#endif
|
||||
#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
|
||||
#define YYSTACK_USE_ALLOCA 1
|
||||
|
||||
#include <ctype.h>
|
||||
#include <errno.h>
|
||||
|
||||
Reference in New Issue
Block a user