mirror of
https://github.com/aljazceru/turso.git
synced 2026-01-04 08:54:20 +01:00
preallocate capacity for yystack (by krishvishal)
This commit is contained in:
@@ -4518,6 +4518,8 @@ void ReportTable(
|
||||
print_stack_union(out,lemp,&lineno);
|
||||
if( lemp->stacksize ){
|
||||
fprintf(out,"const YYSTACKDEPTH: usize = %s;\n",lemp->stacksize); lineno++;
|
||||
} else {
|
||||
fprintf(out, "const YYSTACKDEPTH: usize = 128;\n"); lineno++;
|
||||
}
|
||||
if( lemp->errsym && lemp->errsym->useCnt ){
|
||||
fprintf(out,"const YYERRORSYMBOL: YYCODETYPE = %d;\n",lemp->errsym->index); lineno++;
|
||||
|
||||
@@ -285,7 +285,7 @@ impl yyParser<'_> {
|
||||
yyidx: 0,
|
||||
#[cfg(feature = "YYTRACKMAXSTACKDEPTH")]
|
||||
yyhwm: 0,
|
||||
yystack: Vec::new(),
|
||||
yystack: Vec::with_capacity(YYSTACKDEPTH),
|
||||
//#[cfg(not(feature = "YYNOERRORRECOVERY"))]
|
||||
yyerrcnt: -1,
|
||||
%% /* Optional %extra_context store */
|
||||
|
||||
Reference in New Issue
Block a user