From 6a41bc40af0d6f060e7b47838bd8126081f1e155 Mon Sep 17 00:00:00 2001 From: Oleksii Mandrychenko Date: Wed, 29 Mar 2017 13:53:11 +0100 Subject: [PATCH] [#404] Reading past valid address with multisink logger - Initialising atomic value See examples at http://stackoverflow.com/q/36320008/706456 This issue was discovered with dr memory tool on Windows platform, Visual Studio 2015 C++ 11 --- include/spdlog/details/mpmc_bounded_q.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/spdlog/details/mpmc_bounded_q.h b/include/spdlog/details/mpmc_bounded_q.h index 3a46e8eb..c963bc93 100644 --- a/include/spdlog/details/mpmc_bounded_q.h +++ b/include/spdlog/details/mpmc_bounded_q.h @@ -159,9 +159,9 @@ private: cell_t* const buffer_; size_t const buffer_mask_; cacheline_pad_t pad1_; - std::atomic enqueue_pos_; + std::atomic enqueue_pos_ {0}; cacheline_pad_t pad2_; - std::atomic dequeue_pos_; + std::atomic dequeue_pos_ {0}; cacheline_pad_t pad3_; mpmc_bounded_queue(mpmc_bounded_queue const&) = delete;