Initialize ptr in constructor of handler

This commit is contained in:
Stephen Seo 2024-11-12 14:46:36 +09:00
parent 5a7db8fd09
commit e063957eb6

View file

@ -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;