Skip to content

Commit

Permalink
Disable auto vector reserve in clock
Browse files Browse the repository at this point in the history
  • Loading branch information
suyashmahar committed May 2, 2024
1 parent d9f56cb commit e23b6cd
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion include/nvsl/clock.hh
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,10 @@ namespace nvsl {
static constexpr size_t RAW_VAL_CNT = 1024 * 1024 * 100;

public:
Clock() { raw_values.reserve(RAW_VAL_CNT); }
Clock(bool reserve_raw_vals = false) {
if (reserve_raw_vals)
raw_values.reserve(RAW_VAL_CNT);
}

/** @brief Start the timer */
void tick() {
Expand Down

0 comments on commit e23b6cd

Please sign in to comment.