1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-14 08:54:58 +00:00

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
3 changed files with 0 additions and 31 deletions

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)