<rdar://problem/8805364> Malloc zone enumeration code should be safe in the face...
authormrowe@apple.com <mrowe@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 10 Feb 2011 07:13:19 +0000 (07:13 +0000)
committermrowe@apple.com <mrowe@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 10 Feb 2011 07:13:19 +0000 (07:13 +0000)
Reviewed by Sam Weinig.

* wtf/FastMalloc.cpp:
(WTF::PageHeapAllocator::recordAdministrativeRegions): Use the new helper function to walk the linked list safely.
(WTF::TCMalloc_ThreadCache_FreeList::enumerateFreeObjects): Ditto.
(WTF::TCMalloc_Central_FreeList::enumerateFreeObjects): Ditto.
(WTF::TCMallocStats::PageMapFreeObjectFinder::visit): Bail out if the span could not be read.
(WTF::TCMallocStats::PageMapMemoryUsageRecorder::visit): Ditto.
* wtf/MallocZoneSupport.h:
(WTF::RemoteMemoryReader::operator()): Remove an assert that is not valid.
(WTF::RemoteMemoryReader::nextEntryInLinkedList): Add a helper function for retrieving the next entry in
a linked list. It maps a failed read of the remote memory in to a null pointer, which all callers can
handle gracefully.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@78176 268f45cc-cd09-0410-ab3c-d52691b4dbfc


No differences found