Changeset 25422 in webkit


Ignore:
Timestamp:
Sep 7, 2007, 12:42:47 PM (17 years ago)
Author:
darin
Message:

Reviewed by Steve Falkenburg.

  • fix crash seen on Windows release builds
  • wtf/FastMalloc.cpp: Change pthread_getspecific optimization to be done only on the DARWIN platform. Also correct a couple reinterpret_cast that should be static_cast instead.
Location:
trunk/JavaScriptCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/ChangeLog

    r25413 r25422  
     12007-09-07  Darin Adler  <darin@apple.com>
     2
     3        Reviewed by Steve Falkenburg.
     4
     5        - fix crash seen on Windows release builds
     6
     7        * wtf/FastMalloc.cpp: Change pthread_getspecific optimization to be done only
     8        on the DARWIN platform. Also correct a couple reinterpret_cast that should be
     9        static_cast instead.
     10
    1112007-09-06  Kevin McCullough  <kmccullough@apple.com>
    212
  • trunk/JavaScriptCore/wtf/FastMalloc.cpp

    r25409 r25422  
    193193
    194194#if WTF_CHANGES
     195
    195196#if PLATFORM(DARWIN)
    196197#include "MallocZoneSupport.h"
     198#endif
     199
     200// Calling pthread_getspecific through a global function pointer is faster than a normal
     201// call to the function on Mac OS X, and it's used in performance-critical code. So we
     202// use a function pointer. But that's not necessarily faster on other platforms, and we had
     203// problems with this technique on Windows, so we'll do this only on Mac OS X.
     204#if PLATFORM(DARWIN)
     205static void* (*pthread_getspecific_function_pointer)(pthread_key_t) = pthread_getspecific;
     206#define pthread_getspecific(key) pthread_getspecific_function_pointer(key)
    197207#endif
    198208
     
    12831293static bool tsd_inited = false;
    12841294static pthread_key_t heap_key;
    1285 static void* (*FM_pthread_getspecific)(pthread_key_t) = pthread_getspecific;
    12861295
    12871296// Allocator for thread heaps
     
    15531562    InitModule();
    15541563  } else {
    1555     ptr = FM_pthread_getspecific(heap_key);
     1564    ptr = pthread_getspecific(heap_key);
    15561565  }
    15571566  if (ptr == NULL) ptr = CreateCacheIfNecessary();
    1558   return reinterpret_cast<TCMalloc_ThreadCache*>(ptr);
     1567  return static_cast<TCMalloc_ThreadCache*>(ptr);
    15591568}
    15601569
     
    15641573inline TCMalloc_ThreadCache* TCMalloc_ThreadCache::GetCacheIfPresent() {
    15651574  if (!tsd_inited) return NULL;
    1566   return reinterpret_cast<TCMalloc_ThreadCache*>
    1567     (FM_pthread_getspecific(heap_key));
     1575  return static_cast<TCMalloc_ThreadCache*>(pthread_getspecific(heap_key));
    15681576}
    15691577
     
    16811689  // Remove all memory from heap
    16821690  TCMalloc_ThreadCache* heap;
    1683   heap = reinterpret_cast<TCMalloc_ThreadCache*>(ptr);
     1691  heap = static_cast<TCMalloc_ThreadCache*>(ptr);
    16841692  heap->Cleanup();
    16851693
Note: See TracChangeset for help on using the changeset viewer.