]> git.lizzy.rs Git - rust.git/commitdiff
rustc: Switch ty::node_type_table to smallintmap, cut 400mb memory use off a librustc...
authorGraydon Hoare <graydon@mozilla.com>
Tue, 28 May 2013 02:47:40 +0000 (19:47 -0700)
committerGraydon Hoare <graydon@mozilla.com>
Tue, 28 May 2013 02:50:49 +0000 (19:50 -0700)
Smallintmap was being populated with sparse keys during ast deserialization.

src/librustc/middle/ty.rs

index 6d1ae8ff0e6a8d893cae27b8c5cd8801974ed528..82401555472636a748523d0ddcc27e6e0be7c10e 100644 (file)
@@ -907,7 +907,7 @@ pub struct ty_param_substs_and_ty {
 
 type constness_cache = @mut HashMap<ast::def_id, const_eval::constness>;
 
-pub type node_type_table = @mut SmallIntMap<t>;
+pub type node_type_table = @mut HashMap<uint,t>;
 
 fn mk_rcache() -> creader_cache {
     return @mut HashMap::new();
@@ -934,7 +934,7 @@ pub fn mk_ctxt(s: session::Session,
         def_map: dm,
         region_maps: region_maps,
         region_paramd_items: region_paramd_items,
-        node_types: @mut SmallIntMap::new(),
+        node_types: @mut HashMap::new(),
         node_type_substs: @mut HashMap::new(),
         trait_refs: @mut HashMap::new(),
         trait_defs: @mut HashMap::new(),