Commit f3b388a8 authored by Zhangyi Chen's avatar Zhangyi Chen

Remove butil/allocator/

parent 6486d8f0
......@@ -38,7 +38,6 @@ BUTIL_SOURCES = \
src/butil/third_party/snappy/snappy-stubs-internal.cc \
src/butil/third_party/snappy/snappy.cc \
src/butil/third_party/murmurhash3/murmurhash3.cpp \
src/butil/allocator/type_profiler_control.cc \
src/butil/arena.cpp \
src/butil/at_exit.cc \
src/butil/atomicops_internals_x86_gcc.cc \
......
// Copyright 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "butil/allocator/type_profiler_control.h"
namespace butil {
namespace type_profiler {
namespace {
#if defined(TYPE_PROFILING)
const bool kTypeProfilingEnabled = true;
#else
const bool kTypeProfilingEnabled = false;
#endif
bool g_enable_intercept = kTypeProfilingEnabled;
} // namespace
// static
void Controller::Stop() {
g_enable_intercept = false;
}
// static
bool Controller::IsProfiling() {
return kTypeProfilingEnabled && g_enable_intercept;
}
// static
void Controller::Restart() {
g_enable_intercept = kTypeProfilingEnabled;
}
} // namespace type_profiler
} // namespace butil
// Copyright 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef BASE_ALLOCATOR_TYPE_PROFILER_CONTROL_H_
#define BASE_ALLOCATOR_TYPE_PROFILER_CONTROL_H_
#include "butil/gtest_prod_util.h"
namespace butil {
namespace type_profiler {
class Controller {
public:
static void Stop();
static bool IsProfiling();
private:
FRIEND_TEST_ALL_PREFIXES(TypeProfilerTest,
TestProfileNewWithoutProfiledDelete);
// It must be used only from allowed unit tests. The following is only
// allowed for use in unit tests. Profiling should never be restarted in
// regular use.
static void Restart();
};
} // namespace type_profiler
} // namespace butil
#endif // BASE_ALLOCATOR_TYPE_PROFILER_CONTROL_H_
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment