Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(136)

Unified Diff: runtime/vm/malloc_hooks_tcmalloc.cc

Issue 2974233002: VM: Re-format to use at most one newline between functions (Closed)
Patch Set: Rebase and merge Created 3 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/vm/malloc_hooks_jemalloc.cc ('k') | runtime/vm/malloc_hooks_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/malloc_hooks_tcmalloc.cc
diff --git a/runtime/vm/malloc_hooks_tcmalloc.cc b/runtime/vm/malloc_hooks_tcmalloc.cc
index e5a1a23e02c73a97c10694afe93ffeab55bc6f75..f0e8b2425c30737e627f4d4f8fef196345bc63cf 100644
--- a/runtime/vm/malloc_hooks_tcmalloc.cc
+++ b/runtime/vm/malloc_hooks_tcmalloc.cc
@@ -162,7 +162,6 @@ class AllocationInfo {
intptr_t allocation_size_;
};
-
// Custom key/value trait specifically for address/size pairs. Unlike
// RawPointerKeyValueTrait, the default value is -1 as 0 can be a valid entry.
class AddressKeyValueTrait : public AllStatic {
@@ -184,7 +183,6 @@ class AddressKeyValueTrait : public AllStatic {
static bool IsKeyEqual(Pair kv, Key key) { return kv.key == key; }
};
-
// Map class that will be used to store mappings between ptr -> allocation size.
class AddressMap : public MallocDirectChainedHashMap<AddressKeyValueTrait> {
public:
@@ -222,7 +220,6 @@ class AddressMap : public MallocDirectChainedHashMap<AddressKeyValueTrait> {
}
};
-
// MallocHooks state / locks.
bool MallocHooksState::active_ = false;
bool MallocHooksState::stack_trace_collection_enabled_ = false;
@@ -236,7 +233,6 @@ intptr_t MallocHooksState::allocation_count_ = 0;
intptr_t MallocHooksState::heap_allocated_memory_in_bytes_ = 0;
AddressMap* MallocHooksState::address_map_ = NULL;
-
void MallocHooksState::Init() {
address_map_ = new AddressMap();
active_ = true;
@@ -248,7 +244,6 @@ void MallocHooksState::Init() {
original_pid_ = OS::ProcessId();
}
-
void MallocHooksState::ResetStats() {
ASSERT(malloc_hook_mutex()->IsOwnedByCurrentThread());
allocation_count_ = 0;
@@ -256,7 +251,6 @@ void MallocHooksState::ResetStats() {
address_map_->Clear();
}
-
void MallocHooksState::TearDown() {
ASSERT(malloc_hook_mutex()->IsOwnedByCurrentThread());
active_ = false;
@@ -266,7 +260,6 @@ void MallocHooksState::TearDown() {
address_map_ = NULL;
}
-
void MallocHooks::InitOnce() {
if (!FLAG_profiler_native_memory || MallocHooks::Active()) {
return;
@@ -285,7 +278,6 @@ void MallocHooks::InitOnce() {
ASSERT(success);
}
-
void MallocHooks::TearDown() {
if (!FLAG_profiler_native_memory || !MallocHooks::Active()) {
return;
@@ -304,26 +296,22 @@ void MallocHooks::TearDown() {
MallocHooksState::TearDown();
}
-
bool MallocHooks::ProfilingEnabled() {
return MallocHooksState::ProfilingEnabled();
}
-
bool MallocHooks::stack_trace_collection_enabled() {
MallocLocker ml(MallocHooksState::malloc_hook_mutex(),
MallocHooksState::malloc_hook_mutex_owner());
return MallocHooksState::stack_trace_collection_enabled();
}
-
void MallocHooks::set_stack_trace_collection_enabled(bool enabled) {
MallocLocker ml(MallocHooksState::malloc_hook_mutex(),
MallocHooksState::malloc_hook_mutex_owner());
MallocHooksState::set_stack_trace_collection_enabled(enabled);
}
-
void MallocHooks::ResetStats() {
if (!FLAG_profiler_native_memory) {
return;
@@ -335,7 +323,6 @@ void MallocHooks::ResetStats() {
}
}
-
bool MallocHooks::Active() {
if (!FLAG_profiler_native_memory) {
return false;
@@ -346,7 +333,6 @@ bool MallocHooks::Active() {
return MallocHooksState::Active();
}
-
void MallocHooks::PrintToJSONObject(JSONObject* jsobj) {
if (!FLAG_profiler_native_memory) {
return;
@@ -372,7 +358,6 @@ void MallocHooks::PrintToJSONObject(JSONObject* jsobj) {
}
}
-
intptr_t MallocHooks::allocation_count() {
if (!FLAG_profiler_native_memory) {
return 0;
@@ -382,7 +367,6 @@ intptr_t MallocHooks::allocation_count() {
return MallocHooksState::allocation_count();
}
-
intptr_t MallocHooks::heap_allocated_memory_in_bytes() {
if (!FLAG_profiler_native_memory) {
return 0;
@@ -392,7 +376,6 @@ intptr_t MallocHooks::heap_allocated_memory_in_bytes() {
return MallocHooksState::heap_allocated_memory_in_bytes();
}
-
Sample* MallocHooks::GetSample(const void* ptr) {
MallocLocker ml(MallocHooksState::malloc_hook_mutex(),
MallocHooksState::malloc_hook_mutex_owner());
@@ -409,7 +392,6 @@ Sample* MallocHooks::GetSample(const void* ptr) {
return NULL;
}
-
void MallocHooksState::RecordAllocHook(const void* ptr, size_t size) {
if (MallocHooksState::IsLockHeldByCurrentThread() ||
!MallocHooksState::IsOriginalProcess()) {
@@ -426,7 +408,6 @@ void MallocHooksState::RecordAllocHook(const void* ptr, size_t size) {
}
}
-
void MallocHooksState::RecordFreeHook(const void* ptr) {
if (MallocHooksState::IsLockHeldByCurrentThread() ||
!MallocHooksState::IsOriginalProcess()) {
« no previous file with comments | « runtime/vm/malloc_hooks_jemalloc.cc ('k') | runtime/vm/malloc_hooks_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698