diff options
author | Akim Demaille <demaille@gostai.com> | 2008-08-18 20:20:09 +0200 |
---|---|---|
committer | Akim Demaille <demaille@gostai.com> | 2008-11-11 15:20:03 +0100 |
commit | ce6719605b81aa7b19c6f9615a78a4fd18bfdb42 (patch) | |
tree | f282632ff45ef936a73e3c425d684ec152879ed7 /etc | |
parent | 2873fdf8b1f91a9cbc8d258367c920eb637a0099 (diff) | |
download | bison-ce6719605b81aa7b19c6f9615a78a4fd18bfdb42.tar.gz |
Less memory pressure on the "list" bench.
* etc/bench.pl.in (generate_grammar_list): Do not accumulate all
the values, to limit memory pressure.
Diffstat (limited to 'etc')
-rwxr-xr-x | etc/bench.pl.in | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/etc/bench.pl.in b/etc/bench.pl.in index d058ce19..d365d653 100755 --- a/etc/bench.pl.in +++ b/etc/bench.pl.in @@ -634,12 +634,11 @@ result: text: /* nothing */ { /* This will generate an empty string */ } -| text TEXT { std::swap($$,$1); $$.append($2); } +| text TEXT { std::swap ($$, $2); } | text NUMBER { - std::swap($$,$1); - std::ostringstream ss; + std::ostringstream ss; ss << ' ' << $2; - $$.append(ss.str()); + $$ = ss.str(); } ; EOF @@ -663,11 +662,12 @@ result: text: /* nothing */ { $$ = new std::string; } -| text TEXT { $$->append(*$2); delete $2; } +| text TEXT { delete $1; $$ = $2; } | text NUMBER { - std::ostringstream ss; + delete $1; + std::ostringstream ss; ss << ' ' << $2; - $$->append(ss.str()); + $$ = new std::string (ss.str()); } ; EOF |