+2014-09-11 Geoffrey Garen <ggaren@apple.com>
+
+ Reviewed by Sam Weinig.
+
+ Renamed log => retire for clarity.
+
+ * bmalloc/Allocator.cpp:
+ (bmalloc::Allocator::scavenge):
+ (bmalloc::Allocator::retire):
+ (bmalloc::Allocator::allocateMedium):
+ (bmalloc::Allocator::allocateSlowCase):
+ (bmalloc::Allocator::log): Deleted.
+ * bmalloc/Allocator.h:
+
2014-09-11 Geoffrey Garen <ggaren@apple.com>
bmalloc: eager scavenge leaves behind a bogus allocator
void Allocator::scavenge()
{
for (auto& allocator : m_smallAllocators) {
- log(allocator);
+ retire(allocator);
allocator.clear();
}
processSmallAllocatorLog();
- log(m_mediumAllocator);
+ retire(m_mediumAllocator);
m_mediumAllocator.clear();
processMediumAllocatorLog();
}
-void Allocator::log(SmallAllocator& allocator)
+void Allocator::retire(SmallAllocator& allocator)
{
if (m_smallAllocatorLog.size() == m_smallAllocatorLog.capacity())
processSmallAllocatorLog();
m_smallAllocatorLog.clear();
}
-void Allocator::log(MediumAllocator& allocator)
+void Allocator::retire(MediumAllocator& allocator)
{
if (m_mediumAllocatorLog.size() == m_mediumAllocatorLog.capacity())
processMediumAllocatorLog();
if (allocator.allocate(size, object))
return object;
- log(allocator);
+ retire(allocator);
allocator.refill(m_deallocator.allocateMediumLine());
return allocator.allocate(size);
}
if (size <= smallMax) {
size_t smallSizeClass = smallSizeClassFor(size);
SmallAllocator& allocator = m_smallAllocators[smallSizeClass];
- log(allocator);
+ retire(allocator);
allocator.refill(m_deallocator.allocateSmallLine(smallSizeClass));
return allocator.allocate();
}
void* allocateLarge(size_t);
void* allocateXLarge(size_t);
- void log(SmallAllocator&);
- void log(MediumAllocator&);
+ void retire(SmallAllocator&);
+ void retire(MediumAllocator&);
void processSmallAllocatorLog();
void processMediumAllocatorLog();