Ignore:
Timestamp:
Oct 31, 2007, 6:22:35 PM (18 years ago)
Author:
aroben
Message:

Fix a crash on launch due to a static initializer race

We now use fast inline assembler spinlocks which can be statically
initialized at compile time.

As a side benefit, this speeds up SunSpider by 0.4%.

Reviewed by Oliver.

  • wtf/FastMalloc.cpp:
  • wtf/TCSpinLock.h: (TCMalloc_SpinLock::Lock): (TCMalloc_SpinLock::Unlock): (TCMalloc_SlowLock):
  • wtf/TCSystemAlloc.cpp:
File:
1 edited

Legend:

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

    r27296 r27336  
    12761276
    12771277// Page-level allocator
    1278 #if COMPILER(MSVC)
    1279 static SpinLock pageheap_lock;
    1280 #else
    12811278static SpinLock pageheap_lock = SPINLOCK_INITIALIZER;
    1282 #endif
    1283 
    12841279static void* pageheap_memory[(sizeof(TCMalloc_PageHeap) + sizeof(void*) - 1) / sizeof(void*)];
    12851280static bool phinited = false;
Note: See TracChangeset for help on using the changeset viewer.