Some minor nitpicking.

This commit is contained in:
Daniel Lemire 2020-02-07 10:41:45 -05:00
parent 5c59b3a775
commit 4518f1fba1
3 changed files with 6 additions and 7 deletions

View File

@ -315,7 +315,7 @@ struct feature_benchmarker {
return calc_expected_feature_cost(stage, file) + calc_expected_miss_cost(stage, file); return calc_expected_feature_cost(stage, file) + calc_expected_miss_cost(stage, file);
} }
void print(const option_struct& options) { void print(const option_struct& options) const {
printf("\n"); printf("\n");
printf("Features in ns/block (64 bytes):\n"); printf("Features in ns/block (64 bytes):\n");
printf("\n"); printf("\n");

View File

@ -66,7 +66,6 @@ ostream& verbose() {
void exit_error(string message) { void exit_error(string message) {
cerr << message << endl; cerr << message << endl;
exit(EXIT_FAILURE); exit(EXIT_FAILURE);
abort();
} }
struct json_stats { struct json_stats {
@ -230,7 +229,7 @@ struct progress_bar {
} }
next_tick = tick; next_tick = tick;
} }
void erase() { void erase() const {
for (int i=0;i<next_tick+1;i++) { for (int i=0;i<next_tick+1;i++) {
fprintf(stderr, "\b"); fprintf(stderr, "\b");
} }

View File

@ -63,12 +63,12 @@ struct event_count {
double cache_references() const { return event_counts[CACHE_REFERENCES]; } double cache_references() const { return event_counts[CACHE_REFERENCES]; }
double cache_misses() const { return event_counts[CACHE_MISSES]; } double cache_misses() const { return event_counts[CACHE_MISSES]; }
event_count& operator=(const event_count other) { event_count& operator=(const event_count& other) {
this->elapsed = other.elapsed; this->elapsed = other.elapsed;
this->event_counts = other.event_counts; this->event_counts = other.event_counts;
return *this; return *this;
} }
event_count operator+(const event_count other) const { event_count operator+(const event_count& other) const {
return event_count(elapsed+other.elapsed, { return event_count(elapsed+other.elapsed, {
event_counts[0]+other.event_counts[0], event_counts[0]+other.event_counts[0],
event_counts[1]+other.event_counts[1], event_counts[1]+other.event_counts[1],
@ -78,7 +78,7 @@ struct event_count {
}); });
} }
void operator+=(const event_count other) { void operator+=(const event_count& other) {
*this = *this + other; *this = *this + other;
} }
}; };
@ -91,7 +91,7 @@ struct event_aggregate {
event_aggregate() {} event_aggregate() {}
void operator<<(const event_count other) { void operator<<(const event_count& other) {
if (iterations == 0 || other.elapsed < best.elapsed) { if (iterations == 0 || other.elapsed < best.elapsed) {
best = other; best = other;
} }