Ignore:
Timestamp:
Dec 15, 2008, 4:03:41 AM (16 years ago)
Author:
[email protected]
Message:

Reviewed by Oliver Hunt.

<rdar://problem/6444455> Worker Thread crash running multiple workers for a moderate amount of time

WebCore:

  • dom/WorkerThread.cpp: (WebCore::WorkerThread::workerThread): Detach the thread. Without this, one page of its stack was never unmmaped, and fragmentation made RegisterFile allocaiton fail after a while.

JavaScriptCore:

  • interpreter/RegisterFile.h: (JSC::RegisterFile::RegisterFile): Improve error handling: if mmap fails, crash immediately, and print out the reason.
File:
1 edited

Legend:

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

    r38514 r39297  
    3333#include "Collector.h"
    3434#if HAVE(MMAP)
     35#include <errno.h>
    3536#include <sys/mman.h>
    3637#endif
     
    122123#if HAVE(MMAP)
    123124            m_buffer = static_cast<Register*>(mmap(0, bufferLength, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANON, -1, 0));
    124             ASSERT(reinterpret_cast<intptr_t>(m_buffer) != -1);
     125            if (m_buffer == MAP_FAILED) {
     126                fprintf(stderr, "Could not allocate register file: %d\n", errno);
     127                CRASH();
     128            }
    125129#elif HAVE(VIRTUALALLOC)
    126130            // FIXME: Use VirtualAlloc, and commit pages as we go.
Note: See TracChangeset for help on using the changeset viewer.