Chromium Code Reviews| Index: third_party/tcmalloc/chromium/src/pagemap.h |
| =================================================================== |
| --- third_party/tcmalloc/chromium/src/pagemap.h (revision 138851) |
| +++ third_party/tcmalloc/chromium/src/pagemap.h (working copy) |
| @@ -166,8 +166,11 @@ |
| // TODO(jar): We need a reservation function, but current API to this class |
| // only provides an allocator. |
| // Get decommitted memory. We will commit as necessary. |
| + size_t size = sizeof(*array_) << BITS; |
| array_ = reinterpret_cast<void**>(VirtualAlloc( |
| - NULL, sizeof(*array_) << BITS, MEM_RESERVE, PAGE_READWRITE)); |
| + NULL, size, MEM_RESERVE, PAGE_READWRITE)); |
| + tcmalloc::update_metadata_system_bytes(size); |
| + tcmalloc::update_metadata_unmapped_bytes(size); |
| // Make sure we divided LENGTH evenly. |
| ASSERT(sizeof(committed_) * 8 == (LENGTH * sizeof(*array_)) >> kPageShift); |
| @@ -257,7 +260,7 @@ |
| // TODO(jar): We need a commit that automatically tallies metadata_bytes. |
|
jar (doing other things)
2012/06/04 04:31:28
Should we remove this TODO now?
kaiwang
2012/06/04 18:30:52
Done.
It's not exactly what I did. But I also feel
|
| TCMalloc_SystemCommit(start, length); |
| - tcmalloc::increment_metadata_system_bytes(length); |
| + tcmalloc::update_metadata_unmapped_bytes(-length); |
| #ifndef NDEBUG |
| result = VirtualQuery(start, &info, sizeof(info)); |