Ignore:
Timestamp:
Oct 31, 2007, 12:18:46 AM (18 years ago)
Author:
aroben
Message:

Fix Bug 15586: REGRESSION (r26759-r26785): Windows nightly builds crash with Safari 3 Public Beta

http://bugs.webkit.org/show_bug.cgi?id=15586

Also fixes: <rdar://5565303> Cannot use regsvr32.exe to register WebKit.dll

Use Win32 TLS functions instead of declspec(thread), which breaks
delay-loading.

Reviewed by Steve.

  • wtf/FastMalloc.cpp: (WTF::getThreadHeap): (WTF::TCMalloc_ThreadCache::InitModule):
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/wtf/FastMalloc.cpp

    r26760 r27294  
    191191#include <stdio.h>
    192192#include <string.h>
     193#if COMPILER(MSVC)
     194#define WIN32_LEAN_AND_MEAN
     195#include <windows.h>
     196#endif
    193197
    194198#if WTF_CHANGES
     
    12941298static pthread_key_t heap_key;
    12951299#if COMPILER(MSVC)
    1296 __declspec(thread) TCMalloc_ThreadCache* threadHeap;
     1300DWORD tlsIndex = TLS_OUT_OF_INDEXES;
    12971301#endif
    12981302
     
    13001304{
    13011305#if COMPILER(MSVC)
    1302     return threadHeap;
     1306    return static_cast<TCMalloc_ThreadCache*>(TlsGetValue(tlsIndex));
    13031307#else
    13041308    return static_cast<TCMalloc_ThreadCache*>(pthread_getspecific(heap_key));
     
    13121316    pthread_setspecific(heap_key, heap);
    13131317#if COMPILER(MSVC)
    1314     threadHeap = heap;
     1318    TlsSetValue(tlsIndex, heap);
    13151319#endif
    13161320}
     
    16431647  ASSERT(!tsd_inited);
    16441648  pthread_key_create(&heap_key, DeleteCache);
     1649#if COMPILER(MSVC)
     1650  tlsIndex = TlsAlloc();
     1651#endif
    16451652  tsd_inited = true;
    16461653   
Note: See TracChangeset for help on using the changeset viewer.