Ignore:
Timestamp:
Dec 30, 2010, 11:34:03 AM (14 years ago)
Author:
Patrick Gansterer
Message:

2010-12-30 Patrick Gansterer <Patrick Gansterer>

Reviewed by Darin Adler.

Use OS(WINDOWS) instead of COMPILER(MSVC) in FastMalloc.cpp
https://bugs.webkit.org/show_bug.cgi?id=51743

Most of the ifdefs belong to windows and not to the MSVC compiler.

  • wtf/FastMalloc.cpp:
File:
1 edited

Legend:

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

    r68899 r74802  
    212212#if OS(DARWIN)
    213213#include <malloc/malloc.h>
    214 #elif COMPILER(MSVC)
     214#elif OS(WINDOWS)
    215215#include <malloc.h>
    216216#endif
     
    385385#if OS(DARWIN)
    386386    return malloc_size(p);
    387 #elif COMPILER(MSVC) && !PLATFORM(BREWMP)
     387#elif OS(WINDOWS) && !PLATFORM(BREWMP)
    388388    // Brew MP uses its own memory allocator, so _msize does not work on the Brew MP simulator.
    389389    return _msize(const_cast<void*>(p));
     
    21522152 private:
    21532153  typedef TCMalloc_ThreadCache_FreeList FreeList;
    2154 #if COMPILER(MSVC)
     2154#if OS(WINDOWS)
    21552155  typedef DWORD ThreadIdentifier;
    21562156#else
     
    24432443static bool tsd_inited = false;
    24442444static pthread_key_t heap_key;
    2445 #if COMPILER(MSVC)
     2445#if OS(WINDOWS)
    24462446DWORD tlsIndex = TLS_OUT_OF_INDEXES;
    24472447#endif
     
    24522452    // benefit from the delete callback.
    24532453    pthread_setspecific(heap_key, heap);
    2454 #if COMPILER(MSVC)
     2454#if OS(WINDOWS)
    24552455    TlsSetValue(tlsIndex, heap);
    24562456#endif
     
    29632963  if (KernelSupportsTLS())
    29642964    return threadlocal_heap;
    2965 #elif COMPILER(MSVC)
     2965#elif OS(WINDOWS)
    29662966    return static_cast<TCMalloc_ThreadCache*>(TlsGetValue(tlsIndex));
    29672967#else
     
    29932993  ASSERT(!tsd_inited);
    29942994  pthread_key_create(&heap_key, DestroyThreadCache);
    2995 #if COMPILER(MSVC)
     2995#if OS(WINDOWS)
    29962996  tlsIndex = TlsAlloc();
    29972997#endif
    29982998  tsd_inited = true;
    29992999   
    3000 #if !COMPILER(MSVC)
     3000#if !OS(WINDOWS)
    30013001  // We may have used a fake pthread_t for the main thread.  Fix it.
    30023002  pthread_t zero;
     
    30093009#endif
    30103010  for (TCMalloc_ThreadCache* h = thread_heaps; h != NULL; h = h->next_) {
    3011 #if COMPILER(MSVC)
     3011#if OS(WINDOWS)
    30123012    if (h->tid_ == 0) {
    30133013      h->tid_ = GetCurrentThreadId();
     
    30273027    SpinLockHolder h(&pageheap_lock);
    30283028
    3029 #if COMPILER(MSVC)
     3029#if OS(WINDOWS)
    30303030    DWORD me;
    30313031    if (!tsd_inited) {
     
    30483048    // and added to the linked list.  So we search for that first.
    30493049    for (TCMalloc_ThreadCache* h = thread_heaps; h != NULL; h = h->next_) {
    3050 #if COMPILER(MSVC)
     3050#if OS(WINDOWS)
    30513051      if (h->tid_ == me) {
    30523052#else
Note: See TracChangeset for help on using the changeset viewer.