Chromium Code Reviews| Index: third_party/WebKit/Source/wtf/PartitionAlloc.cpp |
| diff --git a/third_party/WebKit/Source/wtf/PartitionAlloc.cpp b/third_party/WebKit/Source/wtf/PartitionAlloc.cpp |
| index d076568fcfc59bd6984d319884c0c6c19b18d6af..8a8cfa3f3a504e9ff5fc525dbbd1d584bce32827 100644 |
| --- a/third_party/WebKit/Source/wtf/PartitionAlloc.cpp |
| +++ b/third_party/WebKit/Source/wtf/PartitionAlloc.cpp |
| @@ -60,6 +60,8 @@ bool PartitionRootBase::gInitialized = false; |
| PartitionPage PartitionRootBase::gSeedPage; |
| PartitionBucket PartitionRootBase::gPagedBucket; |
| void (*PartitionRootBase::gOomHandlingFunction)() = nullptr; |
| +PartitionAllocHooks::AllocationHook* PartitionAllocHooks::m_allocationHook = nullptr; |
| +PartitionAllocHooks::FreeHook* PartitionAllocHooks::m_freeHook = nullptr; |
| static uint16_t partitionBucketNumSystemPages(size_t size) |
| { |
| @@ -1060,8 +1062,10 @@ void* partitionReallocGeneric(PartitionRootGeneric* root, void* ptr, size_t newS |
| // We may be able to perform the realloc in place by changing the |
| // accessibility of memory pages and, if reducing the size, decommitting |
| // them. |
| - if (partitionReallocDirectMappedInPlace(root, page, newSize)) |
| + if (partitionReallocDirectMappedInPlace(root, page, newSize)) { |
| + PartitionAllocHooks::reallocHookIfEnabled(ptr, ptr, newSize); |
| return ptr; |
| + } |
| } |
| size_t actualNewSize = partitionAllocActualSize(root, newSize); |
| @@ -1085,6 +1089,9 @@ void* partitionReallocGeneric(PartitionRootGeneric* root, void* ptr, size_t newS |
| memcpy(ret, ptr, copySize); |
| partitionFreeGeneric(root, ptr); |
| + |
| + PartitionAllocHooks::reallocHookIfEnabled(ptr, ret, newSize); |
|
haraken
2015/10/20 12:42:00
I don't think this is needed since the above parti
Ruud van Asseldonk
2015/10/20 13:22:16
You are right, fixed.
|
| + |
| return ret; |
| #endif |
| } |