From 41fc8a573ea61b2463606a0714a9e563494da329 Mon Sep 17 00:00:00 2001 From: Andreas Hansson Date: Fri, 19 Sep 2014 10:35:18 -0400 Subject: arch: Pass faults by const reference where possible This patch changes how faults are passed between methods in an attempt to copy as few reference-counting pointer instances as possible. This should avoid unecessary copies being created, contributing to the increment/decrement of the reference counters. --- src/cpu/o3/cpu.hh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/cpu/o3/cpu.hh') diff --git a/src/cpu/o3/cpu.hh b/src/cpu/o3/cpu.hh index f5f9897e7..cfed216c3 100644 --- a/src/cpu/o3/cpu.hh +++ b/src/cpu/o3/cpu.hh @@ -498,7 +498,7 @@ class FullO3CPU : public BaseO3CPU { return globalSeqNum++; } /** Traps to handle given fault. */ - void trap(Fault fault, ThreadID tid, StaticInstPtr inst); + void trap(const Fault &fault, ThreadID tid, StaticInstPtr inst); /** HW return from error interrupt. */ Fault hwrei(ThreadID tid); @@ -509,7 +509,7 @@ class FullO3CPU : public BaseO3CPU Fault getInterrupts(); /** Processes any an interrupt fault. */ - void processInterrupts(Fault interrupt); + void processInterrupts(const Fault &interrupt); /** Halts the CPU. */ void halt() { panic("Halt not implemented!\n"); } -- cgit v1.2.3