1 // BlockAllocatorAreaBucket.cpp
3 #include "BlockAllocatorAreaBucket.h"
6 BlockAllocator::AreaBucket::AreaBucket()
15 BlockAllocator::AreaBucket::~AreaBucket()
17 while (Area
*area
= fAreas
.First()) {
25 BlockAllocator::AreaBucket::SanityCheck(bool deep
) const
28 for (Area
*area
= GetFirstArea(); area
; area
= GetNextArea(area
)) {
30 if (!area
->SanityCheck())
34 if (area
->GetBucket() != this) {
35 FATAL(("Area %p is in bucket %p, but thinks it is in bucket %p\n",
36 area
, this, area
->GetBucket()));
37 BA_PANIC("Wrong area bucket.");
41 size_t areaSize
= area
->GetFreeBytes();
42 if (areaSize
< fMinSize
|| areaSize
>= fMaxSize
) {
43 FATAL(("Area is in wrong bucket: free: %lu, min: %lu, max: %lu\n",
44 areaSize
, fMinSize
, fMaxSize
));
45 BA_PANIC("Area in wrong bucket.");