1 // Copyright 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #if defined(TYPE_PROFILING)
7 #include "base/allocator/type_profiler_tcmalloc.h"
9 #include "base/allocator/type_profiler_control.h"
10 #include "third_party/tcmalloc/chromium/src/gperftools/heap-profiler.h"
11 #include "third_party/tcmalloc/chromium/src/gperftools/type_profiler_map.h"
14 namespace type_profiler
{
16 void* NewInterceptForTCMalloc(void* ptr
,
18 const std::type_info
& type
) {
19 if (Controller::IsProfiling())
20 InsertType(ptr
, size
, type
);
25 void* DeleteInterceptForTCMalloc(void* ptr
,
27 const std::type_info
& type
) {
28 if (Controller::IsProfiling())
34 } // namespace type_profiler
37 #endif // defined(TYPE_PROFILING)