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 <stddef.h> |
7 #include <sys/mman.h> | 8 #include <sys/mman.h> |
8 #include <unistd.h> | 9 #include <unistd.h> |
9 | 10 |
10 #include "base/basictypes.h" | |
11 #include "base/bits.h" | 11 #include "base/bits.h" |
12 #include "base/logging.h" | 12 #include "base/logging.h" |
13 #include "base/process/process_metrics.h" | 13 #include "base/process/process_metrics.h" |
14 | 14 |
15 #ifndef MAP_ANONYMOUS | 15 #ifndef MAP_ANONYMOUS |
16 #define MAP_ANONYMOUS MAP_ANON | 16 #define MAP_ANONYMOUS MAP_ANON |
17 #endif | 17 #endif |
18 | 18 |
19 namespace base { | 19 namespace base { |
20 namespace trace_event { | 20 namespace trace_event { |
(...skipping 29 matching lines...) Expand all Loading... |
50 | 50 |
51 // static | 51 // static |
52 void AllocationRegister::FreeVirtualMemory(void* address, | 52 void AllocationRegister::FreeVirtualMemory(void* address, |
53 size_t allocated_size) { | 53 size_t allocated_size) { |
54 size_t size = bits::Align(allocated_size, GetPageSize()) + GetGuardSize(); | 54 size_t size = bits::Align(allocated_size, GetPageSize()) + GetGuardSize(); |
55 munmap(address, size); | 55 munmap(address, size); |
56 } | 56 } |
57 | 57 |
58 } // namespace trace_event | 58 } // namespace trace_event |
59 } // namespace base | 59 } // namespace base |
OLD | NEW |