Chromium Code Reviews| Index: Source/wtf/PartitionAlloc.cpp |
| diff --git a/Source/wtf/PartitionAlloc.cpp b/Source/wtf/PartitionAlloc.cpp |
| index 43fd01be3a08a82bcb8924c492edd71c1eff0245..6f3a19add76976fa988506d86aff3e4488bd7bb7 100644 |
| --- a/Source/wtf/PartitionAlloc.cpp |
| +++ b/Source/wtf/PartitionAlloc.cpp |
| @@ -30,6 +30,7 @@ |
| #include "config.h" |
| #include "wtf/PartitionAlloc.h" |
| +#include "wtf/Partitions.h" |
|
Chris Evans
2015/04/02 15:53:01
Hmm -- this introduces a circular dependency. Not
haraken
2015/04/02 23:31:31
Done.
|
| #include <string.h> |
| @@ -356,6 +357,7 @@ static ALWAYS_INLINE void* partitionAllocPartitionPages(PartitionRootBase* root, |
| root->nextPartitionPage += totalSize; |
| root->totalSizeOfCommittedPages += totalSize; |
| ASSERT(root->totalSizeOfCommittedPages <= root->totalSizeOfSuperPages + root->totalSizeOfDirectMappedPages); |
| + Partitions::recordMemoryUsageIfNeeded(); |
|
Chris Evans
2015/04/02 15:53:01
To reduce minor code duplication, can we pull both
haraken
2015/04/02 23:31:32
Done.
|
| return ret; |
| } |
| @@ -370,6 +372,7 @@ static ALWAYS_INLINE void* partitionAllocPartitionPages(PartitionRootBase* root, |
| root->totalSizeOfSuperPages += kSuperPageSize; |
| root->totalSizeOfCommittedPages += totalSize; |
| ASSERT(root->totalSizeOfCommittedPages <= root->totalSizeOfSuperPages + root->totalSizeOfDirectMappedPages); |
| + Partitions::recordMemoryUsageIfNeeded(); |
| root->nextSuperPage = superPage + kSuperPageSize; |
| char* ret = superPage + kPartitionPageSize; |
| @@ -615,6 +618,7 @@ static ALWAYS_INLINE void* partitionDirectMap(PartitionRootBase* root, int flags |
| root->totalSizeOfCommittedPages += committedPageSize; |
| root->totalSizeOfDirectMappedPages += committedPageSize; |
| ASSERT(root->totalSizeOfCommittedPages <= root->totalSizeOfSuperPages + root->totalSizeOfDirectMappedPages); |
| + Partitions::recordMemoryUsageIfNeeded(); |
|
Chris Evans
2015/04/02 15:53:01
For consistency, we should probably call the callb
haraken
2015/04/02 23:31:31
Done. Actually we don't need to report memory usag
|
| // TODO: we may want to let the operating system place these allocations |
| // where it pleases. On 32-bit, this might limit address space |