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

Unified Diff: base/trace_event/heap_profiler_allocation_register_posix.cc

Issue 2089253002: [tracing] Optimize AllocationRegister and increase max backtrace depth. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address comments Created 4 years, 6 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
Index: base/trace_event/heap_profiler_allocation_register_posix.cc
diff --git a/base/trace_event/heap_profiler_allocation_register_posix.cc b/base/trace_event/heap_profiler_allocation_register_posix.cc
index c38d7e69182b9a3d73537cc2d4ac148aca9972a1..8caec5e9e935db7f460f32b7d29a1d083d3b086f 100644
--- a/base/trace_event/heap_profiler_allocation_register_posix.cc
+++ b/base/trace_event/heap_profiler_allocation_register_posix.cc
@@ -18,6 +18,7 @@
namespace base {
namespace trace_event {
+namespace internal {
namespace {
size_t GetGuardSize() {
@@ -25,8 +26,7 @@ size_t GetGuardSize() {
}
}
-// static
-void* AllocationRegister::AllocateVirtualMemory(size_t size) {
+void* AllocateGuardedVirtualMemory(size_t size) {
size = bits::Align(size, GetPageSize());
// Add space for a guard page at the end.
@@ -49,11 +49,11 @@ void* AllocationRegister::AllocateVirtualMemory(size_t size) {
}
// static
-void AllocationRegister::FreeVirtualMemory(void* address,
- size_t allocated_size) {
+void FreeGuardedVirtualMemory(void* address, size_t allocated_size) {
size_t size = bits::Align(allocated_size, GetPageSize()) + GetGuardSize();
munmap(address, size);
}
+} // namespace internal
} // namespace trace_event
} // namespace base

Powered by Google App Engine
This is Rietveld 408576698