| Index: base/allocator/allocator_shim_default_dispatch_to_winheap.cc
|
| diff --git a/base/allocator/allocator_shim_default_dispatch_to_winheap.cc b/base/allocator/allocator_shim_default_dispatch_to_winheap.cc
|
| index 2772e0fef6ce8eb0dbb5fc6692fd883b4a16a438..f65e54d6bbdb360f50125e47284a5bbc7ca8ccee 100644
|
| --- a/base/allocator/allocator_shim_default_dispatch_to_winheap.cc
|
| +++ b/base/allocator/allocator_shim_default_dispatch_to_winheap.cc
|
| @@ -11,19 +11,22 @@ namespace {
|
|
|
| using base::allocator::AllocatorDispatch;
|
|
|
| -void* DefaultWinHeapMallocImpl(const AllocatorDispatch*, size_t size) {
|
| +void* DefaultWinHeapMallocImpl(const AllocatorDispatch*,
|
| + size_t size,
|
| + void* context) {
|
| return base::allocator::WinHeapMalloc(size);
|
| }
|
|
|
| void* DefaultWinHeapCallocImpl(const AllocatorDispatch* self,
|
| size_t n,
|
| - size_t elem_size) {
|
| + size_t elem_size,
|
| + void* context) {
|
| // Overflow check.
|
| const size_t size = n * elem_size;
|
| if (elem_size != 0 && size / elem_size != n)
|
| return nullptr;
|
|
|
| - void* result = DefaultWinHeapMallocImpl(self, size);
|
| + void* result = DefaultWinHeapMallocImpl(self, size, context);
|
| if (result) {
|
| memset(result, 0, size);
|
| }
|
| @@ -32,23 +35,28 @@ void* DefaultWinHeapCallocImpl(const AllocatorDispatch* self,
|
|
|
| void* DefaultWinHeapMemalignImpl(const AllocatorDispatch* self,
|
| size_t alignment,
|
| - size_t size) {
|
| + size_t size,
|
| + void* context) {
|
| CHECK(false) << "The windows heap does not support memalign.";
|
| return nullptr;
|
| }
|
|
|
| void* DefaultWinHeapReallocImpl(const AllocatorDispatch* self,
|
| void* address,
|
| - size_t size) {
|
| + size_t size,
|
| + void* context) {
|
| return base::allocator::WinHeapRealloc(address, size);
|
| }
|
|
|
| -void DefaultWinHeapFreeImpl(const AllocatorDispatch*, void* address) {
|
| +void DefaultWinHeapFreeImpl(const AllocatorDispatch*,
|
| + void* address,
|
| + void* context) {
|
| base::allocator::WinHeapFree(address);
|
| }
|
|
|
| size_t DefaultWinHeapGetSizeEstimateImpl(const AllocatorDispatch*,
|
| - void* address) {
|
| + void* address,
|
| + void* context) {
|
| return base::allocator::WinHeapGetSizeEstimate(address);
|
| }
|
|
|
|
|