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

Side by Side Diff: base/allocator/allocator_shim_default_dispatch_to_winheap.cc

Issue 2163783003: Implement a ScopedThreadHeapUsage class to allow profiling per-thread heap usage. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@shim-default
Patch Set: Fix a brain****, may even compile now. Created 4 years, 3 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 unified diff | Download patch
OLDNEW
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
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 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698