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

Unified Diff: base/trace_event/heap_profiler_allocation_register_win.cc

Issue 2089253002: [tracing] Optimize AllocationRegister and increase max backtrace depth. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix Windows 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
« no previous file with comments | « base/trace_event/heap_profiler_allocation_register_unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/trace_event/heap_profiler_allocation_register_win.cc
diff --git a/base/trace_event/heap_profiler_allocation_register_win.cc b/base/trace_event/heap_profiler_allocation_register_win.cc
index bc0afbf340199ca61bfff6fd043ab05353e2bac0..39cbb1807286de16a57d4d731906c21509b724c5 100644
--- a/base/trace_event/heap_profiler_allocation_register_win.cc
+++ b/base/trace_event/heap_profiler_allocation_register_win.cc
@@ -13,6 +13,7 @@
namespace base {
namespace trace_event {
+namespace internal {
namespace {
size_t GetGuardSize() {
@@ -20,8 +21,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.
@@ -50,14 +50,13 @@ void* AllocationRegister::AllocateVirtualMemory(size_t size) {
return addr;
}
-// static
-void AllocationRegister::FreeVirtualMemory(void* address,
- size_t allocated_size) {
+void FreeGuardedVirtualMemory(void* address, size_t allocated_size) {
// For |VirtualFree|, the size passed with |MEM_RELEASE| mut be 0. Windows
// automatically frees the entire region that was reserved by the
// |VirtualAlloc| with flag |MEM_RESERVE|.
VirtualFree(address, 0, MEM_RELEASE);
}
+} // namespace internal
} // namespace trace_event
} // namespace base
« no previous file with comments | « base/trace_event/heap_profiler_allocation_register_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698