| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "base/trace_event/heap_profiler_allocation_register.h" | 5 #include "base/trace_event/heap_profiler_allocation_register.h" |
| 6 | 6 |
| 7 #include <windows.h> | 7 #include <windows.h> |
| 8 #include <stddef.h> |
| 8 | 9 |
| 9 #include "base/bits.h" | 10 #include "base/bits.h" |
| 10 #include "base/logging.h" | 11 #include "base/logging.h" |
| 11 #include "base/process/process_metrics.h" | 12 #include "base/process/process_metrics.h" |
| 12 | 13 |
| 13 namespace base { | 14 namespace base { |
| 14 namespace trace_event { | 15 namespace trace_event { |
| 15 | 16 |
| 16 namespace { | 17 namespace { |
| 17 size_t GetGuardSize() { | 18 size_t GetGuardSize() { |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 53 void AllocationRegister::FreeVirtualMemory(void* address, | 54 void AllocationRegister::FreeVirtualMemory(void* address, |
| 54 size_t allocated_size) { | 55 size_t allocated_size) { |
| 55 // For |VirtualFree|, the size passed with |MEM_RELEASE| mut be 0. Windows | 56 // For |VirtualFree|, the size passed with |MEM_RELEASE| mut be 0. Windows |
| 56 // automatically frees the entire region that was reserved by the | 57 // automatically frees the entire region that was reserved by the |
| 57 // |VirtualAlloc| with flag |MEM_RESERVE|. | 58 // |VirtualAlloc| with flag |MEM_RESERVE|. |
| 58 VirtualFree(address, 0, MEM_RELEASE); | 59 VirtualFree(address, 0, MEM_RELEASE); |
| 59 } | 60 } |
| 60 | 61 |
| 61 } // namespace trace_event | 62 } // namespace trace_event |
| 62 } // namespace base | 63 } // namespace base |
| OLD | NEW |