From 14ae461574b979d75e096bc7fdae28fbab80db57 Mon Sep 17 00:00:00 2001 From: Jarred Sumner Date: Sun, 28 Jul 2024 08:44:48 -0700 Subject: [PATCH] Add MALLOC_HEAP_BREAKDOWN option --- Source/WTF/wtf/text/StringImpl.h | 3 ++- Source/cmake/OptionsJSCOnly.cmake | 8 +++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/Source/WTF/wtf/text/StringImpl.h b/Source/WTF/wtf/text/StringImpl.h index b0553c6dda857..7b86caa467b85 100644 --- a/Source/WTF/wtf/text/StringImpl.h +++ b/Source/WTF/wtf/text/StringImpl.h @@ -175,9 +175,10 @@ class STRING_IMPL_ALIGNMENT StringImplShape { // Right now we use a mix of both, which makes code more confusing and has no benefit. DECLARE_COMPACT_ALLOCATOR_WITH_HEAP_IDENTIFIER(StringImpl); + class StringImpl : private StringImplShape { WTF_MAKE_NONCOPYABLE(StringImpl); - WTF_MAKE_FAST_COMPACT_ALLOCATED_WITH_HEAP_IDENTIFIER(StringImpl); + WTF_MAKE_FAST_COMPACT_ALLOCATED_WITH_HEAP_IDENTIFIER(WTF::StringImpl); friend class AtomStringImpl; friend class JSC::LLInt::Data; diff --git a/Source/cmake/OptionsJSCOnly.cmake b/Source/cmake/OptionsJSCOnly.cmake index 9d30d2d00b790..9d0f6c811fc67 100644 --- a/Source/cmake/OptionsJSCOnly.cmake +++ b/Source/cmake/OptionsJSCOnly.cmake @@ -23,8 +23,14 @@ if (USE_BUN_JSC_ADDITIONS) if (WIN32) SET_AND_EXPOSE_TO_BUILD(JS_NO_EXPORT 1) endif() +WEBKIT_OPTION_END() +WEBKIT_OPTION_BEGIN() +WEBKIT_OPTION_DEFINE(ENABLE_MALLOC_HEAP_BREAKDOWN "Whether to enable MALLOC_HEAP_BREAKDOWN" PUBLIC OFF) + +if(ENABLE_MALLOC_HEAP_BREAKDOWN) + SET_AND_EXPOSE_TO_BUILD(ENABLE_MALLOC_HEAP_BREAKDOWN 1) +endif() -endif () WEBKIT_OPTION_END() WEBKIT_OPTION_BEGIN()