On PS4 we ideally will make no calls into malloc/calloc/free. Currently value profiling is the only source of such calls in libprofile, but even when the compiler emits no value profiling instrumentation we still end up making memory allocation calls.
What do you guys think about adding a check like this? It is conceptually similar to the check for VPDataGatherer which effectively is bailing out early for a somewhat related reason (in that case, it is more generally that some hooks will be null because they aren't present, rather than just "we shouldn't call them").
I've run tests on my Mac laptop and everything passes. I'll do some more thorough checking on PS4 when I'm back in the office on Thu (currently I'm at a conference and don't have easy access to my workstation / devkits).
Does this make sense? As far as testing I was thinking of something like using LD_PRELOAD (and whatever the mac one is) to interpose malloc/calloc/free and verify there are no calls to them.
[1] We'll need to have a separate discussion of controlling VP instrumentation (probably a decision at clang driver based on triple). On PS4 we need to have it off (at least by default) to avoid interacting with a game's dynamic memory allocation.