]> git.saurik.com Git - bison.git/commitdiff
Less memory pressure on the "list" bench.
authorAkim Demaille <demaille@gostai.com>
Mon, 18 Aug 2008 18:20:09 +0000 (20:20 +0200)
committerAkim Demaille <demaille@gostai.com>
Tue, 11 Nov 2008 14:20:03 +0000 (15:20 +0100)
* etc/bench.pl.in (generate_grammar_list): Do not accumulate all
the values, to limit memory pressure.

ChangeLog
etc/bench.pl.in

index b76264cdd7959b7a5306b9753f8ca963e629ae30..811d6fa07e75baaeec50e9101569ac5a332555e9 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -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>
 
        Introduce make_symbol.
index d058ce191d6774c8c348ed9df74185d6007704ab..d365d653cdbc81df43dad37d538a3d9bed9d7940 100755 (executable)
@@ -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