Chromium Code Reviews| Index: base/allocator/winheap_stubs_win.h |
| diff --git a/base/allocator/winheap_stubs_win.h b/base/allocator/winheap_stubs_win.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..103170a1690e6fd270c9b7601db140d9050bf595 |
| --- /dev/null |
| +++ b/base/allocator/winheap_stubs_win.h |
| @@ -0,0 +1,35 @@ |
| +// Copyright (c) 2012 The Chromium Authors. All rights reserved. |
|
Primiano Tucci (use gerrit)
2016/07/13 17:42:49
nit: drop your wayback machine :P (also the new co
Sigurður Ásgeirsson
2016/07/13 18:47:45
Copy-paste FTW.
|
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +// Thin allocation wrappers for the windows heap. This file should be deleted |
| +// once the win-specific allocation shim has been removed, and the generic shim |
| +// has becaome the default. |
| + |
| +#ifndef BASE_ALLOCATOR_ALLOCATOR_WINHEAP_STUBS_H_ |
|
Primiano Tucci (use gerrit)
2016/07/13 17:42:49
nit: s/ALLOCATOR_ALLOCATOR_/ALLOCATOR_/
Sigurður Ásgeirsson
2016/07/13 18:47:45
and again :/
|
| +#define BASE_ALLOCATOR_ALLOCATOR_WINHEAP_STUBS_H_ |
| + |
| +#include <windows.h> |
|
Primiano Tucci (use gerrit)
2016/07/13 17:42:49
not sure you need this windows.h here. Looks like
Sigurður Ásgeirsson
2016/07/13 18:47:45
Done.
|
| + |
| +namespace base { |
| +namespace allocator { |
| + |
| +// Set to true if the link-time magic has successfully hooked into the CRT's |
| +// heap initialization. |
| +extern bool g_is_win_shim_layer_initialized; |
| + |
| +// Thin wrappers to implement the standard C allocation semantics on the |
| +// CRT's Windows heap. |
| +void* WinHeapMalloc(size_t size); |
| +void WinHeapFree(void* size); |
| +void* WinHeapRealloc(void* ptr, size_t size); |
| +void* WinHeapCalloc(size_t n, size_t elem_size); |
| + |
| +// Call the new handler, if one has been set. |
| +// Returns true on successfully calling the handler, false otherwise. |
| +bool WinCallNewHandler(size_t size); |
| + |
| +} // namespace allocator |
| +} // namespace base |
| + |
| +#endif // BASE_ALLOCATOR_ALLOCATOR_WINHEAP_STUBS_H_ |