Skip to content

Commit

Permalink
Since RequestTag's arrival variable is only needed when using delayed
Browse files Browse the repository at this point in the history
tag calculation, protect all references to the variable with
DO_NOT_DELAY_TAG_CALC.

Signed-off-by: J. Eric Ivancich <[email protected]>
  • Loading branch information
ivancich committed Jul 15, 2016
1 parent 79c2093 commit e16e4df
Showing 1 changed file with 14 additions and 5 deletions.
19 changes: 14 additions & 5 deletions src/dmclock_server.h
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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,
Expand All @@ -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);
}
Expand All @@ -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);
}
Expand All @@ -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
}
Expand Down

0 comments on commit e16e4df

Please sign in to comment.