| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/allocator/allocator_shim.h" | 5 #include "base/allocator/allocator_shim.h" |
| 6 | 6 |
| 7 #include "base/allocator/winheap_stubs_win.h" | 7 #include "base/allocator/winheap_stubs_win.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 | 9 |
| 10 namespace { | 10 namespace { |
| (...skipping 29 matching lines...) Expand all Loading... |
| 40 void* DefaultWinHeapReallocImpl(const AllocatorDispatch* self, | 40 void* DefaultWinHeapReallocImpl(const AllocatorDispatch* self, |
| 41 void* address, | 41 void* address, |
| 42 size_t size) { | 42 size_t size) { |
| 43 return base::allocator::WinHeapRealloc(address, size); | 43 return base::allocator::WinHeapRealloc(address, size); |
| 44 } | 44 } |
| 45 | 45 |
| 46 void DefaultWinHeapFreeImpl(const AllocatorDispatch*, void* address) { | 46 void DefaultWinHeapFreeImpl(const AllocatorDispatch*, void* address) { |
| 47 base::allocator::WinHeapFree(address); | 47 base::allocator::WinHeapFree(address); |
| 48 } | 48 } |
| 49 | 49 |
| 50 size_t DefaultWinHeapGetSizeEstimateImpl(const AllocatorDispatch*, |
| 51 void* address) { |
| 52 return base::allocator::WinHeapGetSizeEstimate(address); |
| 53 } |
| 54 |
| 50 } // namespace | 55 } // namespace |
| 51 | 56 |
| 52 const AllocatorDispatch AllocatorDispatch::default_dispatch = { | 57 const AllocatorDispatch AllocatorDispatch::default_dispatch = { |
| 53 &DefaultWinHeapMallocImpl, &DefaultWinHeapCallocImpl, | 58 &DefaultWinHeapMallocImpl, |
| 54 &DefaultWinHeapMemalignImpl, &DefaultWinHeapReallocImpl, | 59 &DefaultWinHeapCallocImpl, |
| 55 &DefaultWinHeapFreeImpl, nullptr, /* next */ | 60 &DefaultWinHeapMemalignImpl, |
| 61 &DefaultWinHeapReallocImpl, |
| 62 &DefaultWinHeapFreeImpl, |
| 63 &DefaultWinHeapGetSizeEstimateImpl, |
| 64 nullptr, /* next */ |
| 56 }; | 65 }; |
| OLD | NEW |