While trying to fix a bug that occurred with Logic when enabling our in-house audio thread allocation detector that works by injecting a malloc hook into the default malloc zone I found out that Logic Pro seems to override the system malloc call with their own implementation.
Out of curiosity: Does anyone have some insight what’s the purpose of that?
This is how I found it out:
auto* zone = malloc_default_zone(); Dl_info info; dladdr ((void*)zone->malloc, &info); std::cout << "The current malloc handler is located in " << info.dli_fname << std::endl;
Under Logic this prints
The current malloc handler is located in /Applications/Logic Pro X.app/Contents/Frameworks/MAAudioEngine.framework/Versions/A/MAAudioEngine
while e.g. under Reaper this prints
The current malloc handler is located in /usr/lib/system/libsystem_malloc.dylib