Loading...
--- libmalloc/libmalloc-166.200.60/src/trace.h
+++ libmalloc/libmalloc-374.120.1/src/trace.h
@@ -30,8 +30,11 @@
 
 #ifndef _MALLOC_BUILDING_CODES_
 #include <sys/kdebug.h>
+__attribute__((cold))
+extern int
+kdebug_trace(uint32_t, uint64_t, uint64_t, uint64_t, uint64_t);
 #define MALLOC_TRACE(code,arg1,arg2,arg3,arg4) \
-	{ if (malloc_tracing_enabled) { kdebug_trace(code, arg1, arg2, arg3, arg4); } }
+	{ if (malloc_traced()) { kdebug_trace(code, arg1, arg2, arg3, arg4); } }
 #define TRACE_CODE(name, subclass, code) \
 	static const int TRACE_##name = KDBG_EVENTID(DBG_UMALLOC, subclass, code)
 #else
@@ -63,6 +66,8 @@
 TRACE_CODE(malloc_memory_pressure, DBG_UMALLOC_INTERNAL, 0x9);
 TRACE_CODE(nano_memory_pressure, DBG_UMALLOC_INTERNAL, 0xa);
 TRACE_CODE(madvise, DBG_UMALLOC_INTERNAL, 0xb);
+TRACE_CODE(medium_malloc, DBG_UMALLOC_INTERNAL, 0xc);
+TRACE_CODE(medium_free, DBG_UMALLOC_INTERNAL, 0xd);
 
 TRACE_CODE(nanov2_region_allocation, DBG_UMALLOC_INTERNAL, 0x10);