From e063957eb6779cffffb3ae2d2e0d15c1a5330623 Mon Sep 17 00:00:00 2001 From: Stephen Seo Date: Tue, 12 Nov 2024 14:46:36 +0900 Subject: [PATCH] Initialize ptr in constructor of handler --- src/another_memcheck.cc | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/another_memcheck.cc b/src/another_memcheck.cc index a5120a9..94a8ea9 100644 --- a/src/another_memcheck.cc +++ b/src/another_memcheck.cc @@ -76,7 +76,7 @@ namespace SC_AM_Internal { return false; } - Stats::Stats() : malloced_list_head(nullptr), malloced_list_tail(nullptr), recursive_mutex(nullptr) { + Stats::Stats() : malloced_list_head(nullptr), malloced_list_tail(nullptr), deferred_node(nullptr), recursive_mutex(nullptr) { } void Stats::initialize() { @@ -89,8 +89,6 @@ namespace SC_AM_Internal { malloced_list_head->data = nullptr; malloced_list_tail->data = nullptr; - deferred_node = nullptr; - recursive_mutex = real_malloc(sizeof(std::recursive_mutex)); void *unused = new(recursive_mutex) std::recursive_mutex{}; (void)unused;