本文整理汇总了C++中Page::Count方法的典型用法代码示例。如果您正苦于以下问题:C++ Page::Count方法的具体用法?C++ Page::Count怎么用?C++ Page::Count使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Page
的用法示例。
在下文中一共展示了Page::Count方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Check
void Heap::Check() {
Mutex::Lock __(mutex);
Init();
if(!work[0]->next)
Init();
for(int i = 0; i < NKLASS; i++) {
DblCheck(work[i]);
DblCheck(full[i]);
Page *p = work[i]->next;
while(p != work[i]) {
Assert(p->heap == this);
Assert(CheckPageFree(p->freelist, p->klass) == p->Count() - p->active);
p = p->next;
}
p = full[i]->next;
while(p != full[i]) {
Assert(p->heap == this);
Assert(p->klass == i);
Assert(p->active == p->Count());
p = p->next;
}
p = empty[i];
if(p) {
for(;;) {
Assert(p->heap == this);
Assert(p->active == 0);
Assert(p->klass == i);
Assert(CheckPageFree(p->freelist, i) == p->Count());
if(this != &aux)
break;
p = p->next;
if(!p)
break;
}
}
FreeLink *l = cache[i];
while(l) {
DbgFreeCheckK(l, i);
l = l->next;
}
}
DLink *l = large->next;
while(l != large) {
Header *bh = (Header *)((byte *)l + LARGEHDRSZ);
while(bh->size) {
Assert((byte *)bh >= (byte *)l + LARGEHDRSZ && (byte *)bh < (byte *)l + 65536);
if(bh->free)
DbgFreeCheck(bh->GetBlock() + 1, bh->size - sizeof(DLink));
bh = bh->Next();
}
l = l->next;
}
if(this != &aux)
aux.Check();
}
示例2: AuxFinalCheck
void Heap::AuxFinalCheck()
{
Mutex::Lock __(mutex);
aux.Init();
aux.FreeRemoteRaw();
aux.Check();
if(!aux.work[0]->next)
aux.Init();
for(int i = 0; i < NKLASS; i++) {
Assert(!aux.cache[i]);
DblCheck(aux.work[i]);
DblCheck(aux.full[i]);
AssertLeaks(aux.work[i] == aux.work[i]->next);
AssertLeaks(aux.full[i] == aux.full[i]->next);
Page *p = aux.empty[i];
if(p) {
for(;;) {
Assert(p->heap == &aux);
Assert(p->active == 0);
Assert(CheckPageFree(p->freelist, p->klass) == p->Count());
p = p->next;
if(!p)
break;
}
}
}
AssertLeaks(aux.large == aux.large->next);
AssertLeaks(big == big->next);
}