From d039542c7c022954ca305a79b379c076900de3d7 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Fri, 14 May 2021 17:16:35 +0200 Subject: [PATCH] AK: Remove unused STRINGIMPL_DEBUG instrumentation --- AK/Debug.h.in | 4 ---- AK/StringImpl.cpp | 26 -------------------------- Meta/CMake/all_the_debug_macros.cmake | 1 - 3 files changed, 31 deletions(-) diff --git a/AK/Debug.h.in b/AK/Debug.h.in index 5b7d50fce7b..e22e8a4a481 100644 --- a/AK/Debug.h.in +++ b/AK/Debug.h.in @@ -350,10 +350,6 @@ #cmakedefine01 SQL_DEBUG #endif -#ifndef STRINGIMPL_DEBUG -#cmakedefine01 STRINGIMPL_DEBUG -#endif - #ifndef SYNTAX_HIGHLIGHTING_DEBUG #cmakedefine01 SYNTAX_HIGHLIGHTING_DEBUG #endif diff --git a/AK/StringImpl.cpp b/AK/StringImpl.cpp index 5903487bd46..c46ff2ae6c4 100644 --- a/AK/StringImpl.cpp +++ b/AK/StringImpl.cpp @@ -4,7 +4,6 @@ * SPDX-License-Identifier: BSD-2-Clause */ -#include #include #include #include @@ -12,21 +11,6 @@ #include #include -#if STRINGIMPL_DEBUG -unsigned g_stringimpl_count; -static HashTable* g_all_live_stringimpls; - -void dump_all_stringimpls(); -void dump_all_stringimpls() -{ - unsigned i = 0; - for (auto& it : *g_all_live_stringimpls) { - dbgln("{}: \"{}\"", i, *it); - ++i; - } -} -#endif - namespace AK { static StringImpl* s_the_empty_stringimpl = nullptr; @@ -43,22 +27,12 @@ StringImpl& StringImpl::the_empty_stringimpl() StringImpl::StringImpl(ConstructWithInlineBufferTag, size_t length) : m_length(length) { -#if STRINGIMPL_DEBUG - if (!g_all_live_stringimpls) - g_all_live_stringimpls = new HashTable; - ++g_stringimpl_count; - g_all_live_stringimpls->set(this); -#endif } StringImpl::~StringImpl() { if (m_fly) FlyString::did_destroy_impl({}, *this); -#if STRINGIMPL_DEBUG - --g_stringimpl_count; - g_all_live_stringimpls->remove(this); -#endif } static inline size_t allocation_size_for_stringimpl(size_t length) diff --git a/Meta/CMake/all_the_debug_macros.cmake b/Meta/CMake/all_the_debug_macros.cmake index 8842f7e9a7e..5e729b11683 100644 --- a/Meta/CMake/all_the_debug_macros.cmake +++ b/Meta/CMake/all_the_debug_macros.cmake @@ -112,7 +112,6 @@ set(DIFF_DEBUG ON) set(HIGHLIGHT_FOCUSED_FRAME_DEBUG ON) set(ITEM_RECTS_DEBUG ON) set(SH_LANGUAGE_SERVER_DEBUG ON) -set(STRINGIMPL_DEBUG ON) set(TEXTEDITOR_DEBUG ON) set(DEFERRED_INVOKE_DEBUG ON) set(DYNAMIC_LOAD_DEBUG ON)