MCPcopy Create free account
hub / github.com/FastLED/FastLED / SetMallocFreeHook

Function SetMallocFreeHook

src/fl/stl/allocator.cpp.hpp:100–107  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

98
99#if defined(FASTLED_TESTING)
100void SetMallocFreeHook(MallocFreeHook* hook) {
101 // Pre-initialize reentrancy counter to avoid recursive malloc during first hook call.
102 // On macOS, ThreadLocal uses pthread_setspecific which calls operator new,
103 // triggering recursive Malloc() that would corrupt the reentrancy counter.
104 (void)tls_reintrancy_count();
105
106 gMallocFreeHook = hook;
107}
108
109void ClearMallocFreeHook() {
110 gMallocFreeHook = nullptr;

Callers 1

FL_TEST_FILEFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected