about summary refs log tree commit diff
path: root/src/nix-env
diff options
context:
space:
mode:
authorEelco Dolstra <e.dolstra@tudelft.nl>2010-10-24T20·09+0000
committerEelco Dolstra <e.dolstra@tudelft.nl>2010-10-24T20·09+0000
commit43535499f38acc04367eeb4dd0d9938e9f8666f8 (patch)
treee563d03b531d47558c89a66f87e358e6bf8f87e0 /src/nix-env
parente0b7fb8f2710ec3012afe6b9d2096f770429a389 (diff)
* When allocating an attribute set, reserve enough space for all
  elements.  This prevents the vector from having to resize itself.

Diffstat (limited to 'src/nix-env')
-rw-r--r--src/nix-env/user-env.cc6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/nix-env/user-env.cc b/src/nix-env/user-env.cc
index acd866197c7c..865d24e2f919 100644
--- a/src/nix-env/user-env.cc
+++ b/src/nix-env/user-env.cc
@@ -61,7 +61,7 @@ bool createUserEnv(EvalState & state, DrvInfos & elems,
 
         Value & v(*state.allocValue());
         manifest.list.elems[n++] = &v;
-        state.mkAttrs(v);
+        state.mkAttrs(v, 8);
 
         mkString(*state.allocAttr(v, state.sType), "derivation");
         mkString(*state.allocAttr(v, state.sName), i->name);
@@ -71,7 +71,7 @@ bool createUserEnv(EvalState & state, DrvInfos & elems,
             mkString(*state.allocAttr(v, state.sDrvPath), i->queryDrvPath(state));
 
         Value & vMeta = *state.allocAttr(v, state.sMeta);
-        state.mkAttrs(vMeta);
+        state.mkAttrs(vMeta, 16);
 
         MetaInfo meta = i->queryMetaInfo(state);
 
@@ -118,7 +118,7 @@ bool createUserEnv(EvalState & state, DrvInfos & elems,
     /* Construct a Nix expression that calls the user environment
        builder with the manifest as argument. */
     Value args, topLevel;
-    state.mkAttrs(args);
+    state.mkAttrs(args, 3);
     mkString(*state.allocAttr(args, state.sSystem), thisSystem);
     mkString(*state.allocAttr(args, state.symbols.create("manifest")),
         manifestFile, singleton<PathSet>(manifestFile));