From 3c4ce7951868efb17ab02dcd452d969f8eb1bb12 Mon Sep 17 00:00:00 2001 From: Graydon Hoare Date: Mon, 27 May 2013 19:47:40 -0700 Subject: [PATCH] rustc: Switch ty::node_type_table to smallintmap, cut 400mb memory use off a librustc build. Smallintmap was being populated with sparse keys during ast deserialization. --- src/librustc/middle/ty.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/librustc/middle/ty.rs b/src/librustc/middle/ty.rs index 6d1ae8ff0e6a8..8240155547263 100644 --- a/src/librustc/middle/ty.rs +++ b/src/librustc/middle/ty.rs @@ -907,7 +907,7 @@ type type_cache = @mut HashMap; type constness_cache = @mut HashMap; -pub type node_type_table = @mut SmallIntMap; +pub type node_type_table = @mut HashMap; 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(),