mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-09 04:13:03 +00:00
Less memory pressure on the "list" bench.
* etc/bench.pl.in (generate_grammar_list): Do not accumulate all the values, to limit memory pressure.
This commit is contained in:
@@ -1,3 +1,9 @@
|
|||||||
|
2008-11-11 Akim Demaille <demaille@gostai.com>
|
||||||
|
|
||||||
|
Less memory pressure on the "list" bench.
|
||||||
|
* etc/bench.pl.in (generate_grammar_list): Do not accumulate all
|
||||||
|
the values, to limit memory pressure.
|
||||||
|
|
||||||
2008-11-11 Akim Demaille <demaille@gostai.com>
|
2008-11-11 Akim Demaille <demaille@gostai.com>
|
||||||
|
|
||||||
Introduce make_symbol.
|
Introduce make_symbol.
|
||||||
|
|||||||
@@ -634,12 +634,11 @@ result:
|
|||||||
|
|
||||||
text:
|
text:
|
||||||
/* nothing */ { /* This will generate an empty string */ }
|
/* nothing */ { /* This will generate an empty string */ }
|
||||||
| text TEXT { std::swap($$,$1); $$.append($2); }
|
| text TEXT { std::swap ($$, $2); }
|
||||||
| text NUMBER {
|
| text NUMBER {
|
||||||
std::swap($$,$1);
|
std::ostringstream ss;
|
||||||
std::ostringstream ss;
|
|
||||||
ss << ' ' << $2;
|
ss << ' ' << $2;
|
||||||
$$.append(ss.str());
|
$$ = ss.str();
|
||||||
}
|
}
|
||||||
;
|
;
|
||||||
EOF
|
EOF
|
||||||
@@ -663,11 +662,12 @@ result:
|
|||||||
|
|
||||||
text:
|
text:
|
||||||
/* nothing */ { $$ = new std::string; }
|
/* nothing */ { $$ = new std::string; }
|
||||||
| text TEXT { $$->append(*$2); delete $2; }
|
| text TEXT { delete $1; $$ = $2; }
|
||||||
| text NUMBER {
|
| text NUMBER {
|
||||||
std::ostringstream ss;
|
delete $1;
|
||||||
|
std::ostringstream ss;
|
||||||
ss << ' ' << $2;
|
ss << ' ' << $2;
|
||||||
$$->append(ss.str());
|
$$ = new std::string (ss.str());
|
||||||
}
|
}
|
||||||
;
|
;
|
||||||
EOF
|
EOF
|
||||||
|
|||||||
Reference in New Issue
Block a user