Ignore:
Timestamp:
Feb 26, 2014, 1:17:35 PM (11 years ago)
Author:
[email protected]
Message:

FastMalloc should use vm_page_shift intead of PAGE_SHIFT.
https://bugs.webkit.org/show_bug.cgi?id=129370

Reviewed by Mark Rowe.

"Doesn't this lead to the page map using fewer bits than it was before?
It seems like this will cause some page addresses to no longer be
representable in the map when using 4K pages. Am I missing something?"

  • wtf/FastMalloc.cpp:
    • bdash raises a valid point. This should make the TCMalloc_PageMap larger than absolutely necessary, rather than potentially too small.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WTF/wtf/FastMalloc.cpp

    r164728 r164742  
    637637// sense.  In particular, if kMaxSize increases, you may have to
    638638// increase kNumClasses as well.
     639#define K_PAGE_SHIFT_MIN 12
    639640#define K_PAGE_SHIFT_MAX 14
    640641#define K_NUM_CLASSES_MAX 77
     
    16651666template <int BITS> class MapSelector {
    16661667 public:
    1667   typedef TCMalloc_PageMap3<BITS-K_PAGE_SHIFT_MAX> Type;
     1668  typedef TCMalloc_PageMap3<BITS-K_PAGE_SHIFT_MIN> Type;
    16681669  typedef PackedCache<BITS, uint64_t> CacheType;
    16691670};
     
    16831684template <> class MapSelector<64> {
    16841685 public:
    1685   typedef TCMalloc_PageMap3<64 - K_PAGE_SHIFT_MAX - kBitsUnusedOn64Bit> Type;
     1686  typedef TCMalloc_PageMap3<64 - K_PAGE_SHIFT_MIN - kBitsUnusedOn64Bit> Type;
    16861687  typedef PackedCache<64, uint64_t> CacheType;
    16871688};
     
    16911692template <> class MapSelector<32> {
    16921693 public:
    1693   typedef TCMalloc_PageMap2<32 - K_PAGE_SHIFT_MAX> Type;
    1694   typedef PackedCache<32 - K_PAGE_SHIFT_MAX, uint16_t> CacheType;
     1694  typedef TCMalloc_PageMap2<32 - K_PAGE_SHIFT_MIN> Type;
     1695  typedef PackedCache<32 - K_PAGE_SHIFT_MIN, uint16_t> CacheType;
    16951696};
    16961697
Note: See TracChangeset for help on using the changeset viewer.