Skip to content

Commit 6837a3b

Browse files
committed
Disable all mentions of malloc_logger unless we're not building for iOS or we're building in debug
1 parent a8e1e03 commit 6837a3b

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

WTF/wtf/FastMalloc.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1569,15 +1569,17 @@ class FastMallocZone {
15691569
PageHeapAllocator<TCMalloc_ThreadCache>* m_pageHeapAllocator;
15701570
};
15711571

1572+
#if !PLATFORM(IOS) || !defined(NDEBUG)
15721573
// This method declaration, and the constants below, are taken from Libc/gen/malloc.c.
15731574
extern "C" void (*malloc_logger)(uint32_t typeFlags, uintptr_t zone, uintptr_t size, uintptr_t pointer, uintptr_t returnValue, uint32_t numberOfFramesToSkip);
1575+
#endif
15741576

15751577
#endif
15761578

15771579
class MallocHook {
15781580
static bool stackLoggingEnabled;
15791581

1580-
#if OS(DARWIN)
1582+
#if OS(DARWIN) && (!PLATFORM(IOS) || !defined(NDEBUG))
15811583

15821584
enum StackLoggingType {
15831585
StackLoggingTypeAlloc = 2,
@@ -1607,13 +1609,13 @@ class MallocHook {
16071609
public:
16081610
static void init()
16091611
{
1610-
#if OS(DARWIN)
1612+
#if OS(DARWIN) && (!PLATFORM(IOS) || !defined(NDEBUG))
16111613
// If the system allocator's malloc_logger has been set up then stack logging is enabled.
16121614
stackLoggingEnabled = malloc_logger;
16131615
#endif
16141616
}
16151617

1616-
#if OS(DARWIN)
1618+
#if OS(DARWIN) && (!PLATFORM(IOS) || !defined(NDEBUG))
16171619
static ALWAYS_INLINE void InvokeNewHook(void* pointer, size_t size)
16181620
{
16191621
if (UNLIKELY(stackLoggingEnabled))

0 commit comments

Comments
 (0)