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/translation.hh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/cpu/translation.hh') diff --git a/src/cpu/translation.hh b/src/cpu/translation.hh index 46c96a0d4..f870a9c11 100644 --- a/src/cpu/translation.hh +++ b/src/cpu/translation.hh @@ -111,7 +111,7 @@ class WholeTranslationState * request to make it easier to access them later on. */ bool - finish(Fault fault, int index) + finish(const Fault &fault, int index) { assert(outstanding); faults[index] = fault; @@ -249,7 +249,7 @@ class DataTranslation : public BaseTLB::Translation * translation is complete if the state says so. */ void - finish(Fault fault, RequestPtr req, ThreadContext *tc, + finish(const Fault &fault, RequestPtr req, ThreadContext *tc, BaseTLB::Mode mode) { assert(state); -- cgit v1.2.3