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

Side by Side Diff: base/allocator/winheap_stubs_win.h

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, 4 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 // Thin allocation wrappers for the windows heap. This file should be deleted 5 // Thin allocation wrappers for the windows heap. This file should be deleted
6 // once the win-specific allocation shim has been removed, and the generic shim 6 // once the win-specific allocation shim has been removed, and the generic shim
7 // has becaome the default. 7 // has becaome the default.
8 8
9 #ifndef BASE_ALLOCATOR_WINHEAP_STUBS_H_ 9 #ifndef BASE_ALLOCATOR_WINHEAP_STUBS_H_
10 #define BASE_ALLOCATOR_WINHEAP_STUBS_H_ 10 #define BASE_ALLOCATOR_WINHEAP_STUBS_H_
11 11
12 #include <stdint.h> 12 #include <stdint.h>
13 13
14 namespace base { 14 namespace base {
15 namespace allocator { 15 namespace allocator {
16 16
17 // Set to true if the link-time magic has successfully hooked into the CRT's 17 // Set to true if the link-time magic has successfully hooked into the CRT's
18 // heap initialization. 18 // heap initialization.
19 extern bool g_is_win_shim_layer_initialized; 19 extern bool g_is_win_shim_layer_initialized;
20 20
21 // Thin wrappers to implement the standard C allocation semantics on the 21 // Thin wrappers to implement the standard C allocation semantics on the
22 // CRT's Windows heap. 22 // CRT's Windows heap.
23 void* WinHeapMalloc(size_t size); 23 void* WinHeapMalloc(size_t size);
24 void WinHeapFree(void* size); 24 void WinHeapFree(void* ptr);
25 void* WinHeapRealloc(void* ptr, size_t size); 25 void* WinHeapRealloc(void* ptr, size_t size);
26 26
27 // Returns a lower-bound estimate for the full amount of memory consumed by the
28 // the allocation |ptr|.
29 size_t WinHeapGetSizeEstimate(void* ptr);
30
27 // Call the new handler, if one has been set. 31 // Call the new handler, if one has been set.
28 // Returns true on successfully calling the handler, false otherwise. 32 // Returns true on successfully calling the handler, false otherwise.
29 bool WinCallNewHandler(size_t size); 33 bool WinCallNewHandler(size_t size);
30 34
31 } // namespace allocator 35 } // namespace allocator
32 } // namespace base 36 } // namespace base
33 37
34 #endif // BASE_ALLOCATOR_WINHEAP_STUBS_H_ 38 #endif // BASE_ALLOCATOR_WINHEAP_STUBS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698