tcmalloc: compile heap profiler code only when explicitly requested

Conditionally compile the heap profiler code and its dependencies when
enable_profiling is set to true.
This removes 9 static initializers in with the new
tcmalloc in release builds.

TEST=Unit tests pass

Change-Id: I99adbf662d97f40304e698661506ad0d2c066d79
Commit-Queue: Gabriel Marin <>
Reviewed-by: Will Harris <>
Cr-Commit-Position: refs/heads/master@{#636570}
2 files changed