AK: Remove unused STRINGIMPL_DEBUG instrumentation

This commit is contained in:
Andreas Kling 2021-05-14 17:16:35 +02:00
parent 5fd65adb19
commit d039542c7c
Notes: sideshowbarker 2024-07-18 18:09:27 +09:00
3 changed files with 0 additions and 31 deletions

View file

@ -350,10 +350,6 @@
#cmakedefine01 SQL_DEBUG
#endif
#ifndef STRINGIMPL_DEBUG
#cmakedefine01 STRINGIMPL_DEBUG
#endif
#ifndef SYNTAX_HIGHLIGHTING_DEBUG
#cmakedefine01 SYNTAX_HIGHLIGHTING_DEBUG
#endif

View file

@ -4,7 +4,6 @@
* SPDX-License-Identifier: BSD-2-Clause
*/
#include <AK/Debug.h>
#include <AK/FlyString.h>
#include <AK/Memory.h>
#include <AK/StdLibExtras.h>
@ -12,21 +11,6 @@
#include <AK/StringImpl.h>
#include <AK/kmalloc.h>
#if STRINGIMPL_DEBUG
unsigned g_stringimpl_count;
static HashTable<StringImpl*>* 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<StringImpl*>;
++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)

View file

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