Ignore:
Timestamp:
Jun 30, 2008, 4:21:43 AM (17 years ago)
Author:
[email protected]
Message:

Reviewed by Cameron Zwarich.

Make RegisterFile really unmap memory on destruction.

This fixes run-webkit-tests --threaded, which ran out of address space in a few seconds.

  • VM/RegisterFile.cpp: (KJS::RegisterFile::~RegisterFile): Unmap all the memory, not just 1/4 of it.
  • kjs/JSGlobalObject.h: Don't include RegisterFile.h, so that changes to it don't make half of WebCore rebuild.
  • VM/Machine.h: Don't forward declare RegisterFile, as RegisterFile.h is included already.
  • VM/RegisterFile.h: (KJS::RegisterFile::RegisterFile): Assert that the allocation succeeded.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/VM/RegisterFile.h

    r34839 r34886  
    121121#if HAVE(MMAP)
    122122            m_buffer = static_cast<Register*>(mmap(0, bufferLength, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANON, -1, 0));
     123            ASSERT(reinterpret_cast<intptr_t>(m_buffer) != -1);
    123124#elif HAVE(VIRTUALALLOC)
    124125            // FIXME: Use VirtualAlloc, and commit pages as we go.
    125126            m_buffer = static_cast<Register*>(fastMalloc(bufferLength));
     127            ASSERT(m_buffer);
    126128#else
    127129            #error "Don't know how to reserve virtual memory on this platform."
     
    172174    private:
    173175        size_t m_size;
    174         size_t m_capacity;
     176        const size_t m_capacity;
    175177        size_t m_numGlobals;
    176         size_t m_maxGlobals;
     178        const size_t m_maxGlobals;
    177179        Register* m_base;
    178180        Register* m_buffer;
Note: See TracChangeset for help on using the changeset viewer.