From e16e4dfd6dd9a41ad8c9e422c0d0550d1048ceef Mon Sep 17 00:00:00 2001 From: "J. Eric Ivancich" Date: Fri, 15 Jul 2016 15:48:23 -0400 Subject: [PATCH] Since RequestTag's arrival variable is only needed when using delayed tag calculation, protect all references to the variable with DO_NOT_DELAY_TAG_CALC. Signed-off-by: J. Eric Ivancich --- src/dmclock_server.h | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/src/dmclock_server.h b/src/dmclock_server.h index d466307..43dadc3 100644 --- a/src/dmclock_server.h +++ b/src/dmclock_server.h @@ -12,7 +12,7 @@ * when an idle client became active */ // #define USE_PROP_HEAP -// #define DO_NOT_DELAY_TAG_CALC +#define DO_NOT_DELAY_TAG_CALC #pragma once @@ -101,7 +101,9 @@ namespace crimson { double proportion; double limit; bool ready; // true when within limit +#ifndef DO_NOT_DELAY_TAG_CALC Time arrival; +#endif RequestTag(const RequestTag& prev_tag, const ClientInfo& client, @@ -124,6 +126,9 @@ namespace crimson { req_params.delta, false)), ready(false) +#ifndef DO_NOT_DELAY_TAG_CALC + , arrival(time) +#endif { assert(reservation < max_tag || proportion < max_tag); } @@ -132,8 +137,10 @@ namespace crimson { reservation(_res), proportion(_prop), limit(_lim), - ready(false), - arrival(_arrival) + ready(false) +#ifndef DO_NOT_DELAY_TAG_CALC + , arrival(_arrival) +#endif { assert(reservation < max_tag || proportion < max_tag); } @@ -142,8 +149,10 @@ namespace crimson { reservation(other.reservation), proportion(other.proportion), limit(other.limit), - ready(other.ready), - arrival(other.arrival) + ready(other.ready) +#ifndef DO_NOT_DELAY_TAG_CALC + , arrival(other.arrival) +#endif { // empty }