Ignore:
Timestamp:
Sep 2, 2010, 5:57:58 AM (15 years ago)
Author:
[email protected]
Message:

2010-09-02 Alexey Proskuryakov <[email protected]>

Reviewed by Oliver Hunt.

https://bugs.webkit.org/show_bug.cgi?id=43230
<rdar://problem/8254215> REGRESSION: Memory leak within JSParser::JSParser

One can't delete a ThreadSpecific object that has data in it. It's not even possible to
enumerate data objects in all threads, much less destroy them from a thread that's destroying
the ThreadSpecific.

  • parser/JSParser.cpp: (JSC::JSParser::JSParser):
  • runtime/JSGlobalData.h:
  • wtf/WTFThreadData.cpp: (WTF::WTFThreadData::WTFThreadData):
  • wtf/WTFThreadData.h: (WTF::WTFThreadData::approximatedStackStart): Moved stack guard tracking from JSGlobalData to WTFThreadData.
  • wtf/ThreadSpecific.h: Made destructor unimplemented. It's dangerous, and we probably won't ever face a situation where we'd want to delete a ThreadSpecific object.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/parser/JSParser.cpp

    r65104 r66665  
    3434#include "ASTBuilder.h"
    3535#include <wtf/HashFunctions.h>
     36#include <wtf/WTFThreadData.h>
    3637#include <utility>
    3738
     
    221222    , m_syntaxAlreadyValidated(provider->isValid())
    222223{
    223     m_endAddress = *(globalData->stackGuards);
    224     if (!m_endAddress) {
    225         char sample = 0;
    226         m_endAddress = &sample - kMaxParserStackUsage;
    227         *(globalData->stackGuards) = m_endAddress;
    228     }
     224    m_endAddress = wtfThreadData().approximatedStackStart() - kMaxParserStackUsage;
    229225    next();
    230226    m_lexer->setLastLineNumber(tokenLine());
Note: See TracChangeset for help on using the changeset viewer.