From d60889b13cf634e1cbc22fb567b88a1707452876 Mon Sep 17 00:00:00 2001 From: Alpha Chen Date: Sun, 8 Jan 2017 11:12:48 -0800 Subject: [PATCH] [2016][rust][23.1] No inlining for profiling? --- 2016/rust/src/assembunny.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/2016/rust/src/assembunny.rs b/2016/rust/src/assembunny.rs index 9871625..6f09ae6 100644 --- a/2016/rust/src/assembunny.rs +++ b/2016/rust/src/assembunny.rs @@ -10,10 +10,12 @@ pub struct Assembunny { } impl Assembunny { + #[inline(never)] fn instruction(&self, i: usize) -> Option { self.instructions.get(i).cloned() } + #[inline(never)] fn value>(&self, v: V) -> isize { let v: Variable = v.into(); match v { @@ -22,6 +24,7 @@ impl Assembunny { } } + #[inline(never)] fn toggle(&mut self, i: usize) { let instruction = match self.instruction(i) { Some(x) => x, @@ -42,6 +45,7 @@ impl Assembunny { impl Iterator for Assembunny { type Item = Registers; + #[inline(never)] fn next(&mut self) -> Option { let pc = self.value(Register::PC) as usize; let instruction = match self.instruction(pc) {