tcmalloc_unittest: Use malloc and free directly, instead of tc_malloc and tc_free.

tcmalloc defines malloc and free as wrappers (or aliases) for tc_malloc
and tc_free, so we can test tcmalloc by using malloc and free directly
instead of tc_malloc and tc_free. This fixes the test in component
builds, where tc_malloc and tc_free are defined in a separate DSO with
hidden visibility (due to https://codereview.chromium.org/2019183002/),
and so will not be visible to tests.

Some compilers (e.g. clang) will specifically recognize and optimize
away calls to malloc and free, which would break these tests, as
they are testing specific behavior of the allocator. Address this by
marking the wrappers for malloc and free as NOINLINE.

BUG=
[email protected]

Review-Url: https://codereview.chromium.org/2028183002
Cr-Commit-Position: refs/heads/master@{#397204}
1 file changed