Пример #1
0
inline void sweepList(ListT* head, std::list<Box*, StlCompatAllocator<Box*>>& weakly_referenced, Free free_func) {
    auto cur = head;
    while (cur) {
        GCAllocation* al = cur->data;
        if (isMarked(al)) {
            clearMark(al);
            cur = cur->next;
        } else {
            if (_doFree(al, &weakly_referenced)) {

                removeFromLL(cur);

                auto to_free = cur;
                cur = cur->next;
                free_func(to_free);
            }
        }
    }
}
Пример #2
0
void Heap::destructContents(GCAllocation* al) {
    _doFree(al, NULL);
}