Ejemplo n.º 1
0
void VMHeap::grow()
{
    SuperChunk* superChunk = SuperChunk::create();
#if BOS(DARWIN)
    m_zone.addSuperChunk(superChunk);
#endif

    SmallChunk* smallChunk = superChunk->smallChunk();
    for (auto* it = smallChunk->begin(); it != smallChunk->end(); ++it)
        m_smallPages.push(it);

    MediumChunk* mediumChunk = superChunk->mediumChunk();
    for (auto* it = mediumChunk->begin(); it != mediumChunk->end(); ++it)
        m_mediumPages.push(it);

    LargeChunk* largeChunk = superChunk->largeChunk();
    m_largeObjects.insert(LargeObject(LargeObject::init(largeChunk).begin()));
}
void VMHeap::allocateMediumChunk()
{
    MediumChunk* chunk = MediumChunk::create();
    for (auto* it = chunk->begin(); it != chunk->end(); ++it)
        m_mediumPages.push(it);
}