From e23b6cd91130ba122c1a147c2455ac7ec1277fd0 Mon Sep 17 00:00:00 2001 From: Suyash Mahar Date: Thu, 2 May 2024 10:53:13 -0700 Subject: [PATCH] Disable auto vector reserve in clock --- include/nvsl/clock.hh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/include/nvsl/clock.hh b/include/nvsl/clock.hh index 1dfcda3..cd0e2e0 100644 --- a/include/nvsl/clock.hh +++ b/include/nvsl/clock.hh @@ -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() {