about summary refs log tree commit diff
path: root/src/libexpr/parser.y
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2013-10-08T13·19+0200
committerEelco Dolstra <eelco.dolstra@logicblox.com>2013-10-08T13·36+0200
commit9deb822180fb80638559fe3c45c6a77a2b56ff40 (patch)
treeaa11694219d4ce88f028de4c8acd18cbd4f8b975 /src/libexpr/parser.y
parentb1e3b1a4ac8c276f503713f6002c3b42efef2ae8 (diff)
Deduplicate filenames in Pos
This saves ~4 MiB of RAM for NixOS system instantiation, and ~18 MiB
for "nix-env -qa".
Diffstat (limited to 'src/libexpr/parser.y')
-rw-r--r--src/libexpr/parser.y4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/libexpr/parser.y b/src/libexpr/parser.y
index 6a282e90546f..dab71546f108 100644
--- a/src/libexpr/parser.y
+++ b/src/libexpr/parser.y
@@ -29,7 +29,7 @@ namespace nix {
         SymbolTable & symbols;
         Expr * result;
         Path basePath;
-        Path path;
+        Symbol path;
         string error;
         Symbol sLetBody;
         ParseData(EvalState & state)
@@ -486,7 +486,7 @@ Expr * EvalState::parse(const char * text,
     yyscan_t scanner;
     ParseData data(*this);
     data.basePath = basePath;
-    data.path = path;
+    data.path = data.symbols.create(path);
 
     yylex_init(&scanner);
     yy_scan_string(text, scanner);