From 68469be89bd7652cf12a0fe74fb6cd6c5915498d Mon Sep 17 00:00:00 2001 From: Oliver Schneider Date: Mon, 20 Jun 2016 16:52:53 +0200 Subject: [PATCH] rename function cache member --- src/memory.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/memory.rs b/src/memory.rs index a7fecd773c90..be0cd0ef4f32 100644 --- a/src/memory.rs +++ b/src/memory.rs @@ -60,7 +60,7 @@ pub struct Memory<'tcx> { /// we can figure out what they point to. functions: HashMap>, /// Inverse map of `functions` so we don't allocate a new pointer every time we need one - function_definitions: HashMap, AllocId>, + function_alloc_cache: HashMap, AllocId>, next_id: AllocId, pub pointer_size: usize, } @@ -71,7 +71,7 @@ pub fn new(pointer_size: usize) -> Self { Memory { alloc_map: HashMap::new(), functions: HashMap::new(), - function_definitions: HashMap::new(), + function_alloc_cache: HashMap::new(), next_id: AllocId(0), pointer_size: pointer_size, } @@ -83,7 +83,7 @@ pub fn create_fn_ptr(&mut self, def_id: DefId, substs: &'tcx Substs<'tcx>, fn_ty substs: substs, fn_ty: fn_ty, }; - if let Some(&alloc_id) = self.function_definitions.get(&def) { + if let Some(&alloc_id) = self.function_alloc_cache.get(&def) { return Pointer { alloc_id: alloc_id, offset: 0, @@ -93,7 +93,7 @@ pub fn create_fn_ptr(&mut self, def_id: DefId, substs: &'tcx Substs<'tcx>, fn_ty debug!("creating fn ptr: {}", id); self.next_id.0 += 1; self.functions.insert(id, def); - self.function_definitions.insert(def, id); + self.function_alloc_cache.insert(def, id); Pointer { alloc_id: id, offset: 0,