Changeset 166956 in webkit


Ignore:
Timestamp:
Apr 8, 2014, 1:36:07 PM (11 years ago)
Author:
ggaren@apple.com
Message:

Made bmalloc more #include friendly
https://bugs.webkit.org/show_bug.cgi?id=131386

Reviewed by Andreas Kling.

Marked a bunch of headers private so they can be used from client code
that #includes bmalloc.h.

Renamed ASSERT macros to BASSERT. This matches their header, which already
had to be renamed, and fixes conflicts with WTF's ASSERT macros.

  • bmalloc.xcodeproj/project.pbxproj:
  • bmalloc/Allocator.cpp:

(bmalloc::Allocator::allocateSlowCase):

  • bmalloc/AsyncTask.h:

(bmalloc::Function>::runSlowCase):

  • bmalloc/BAssert.h:
  • bmalloc/BoundaryTag.h:

(bmalloc::BoundaryTag::setSize):

  • bmalloc/BoundaryTagInlines.h:

(bmalloc::validate):
(bmalloc::BoundaryTag::init):
(bmalloc::BoundaryTag::deallocate):
(bmalloc::BoundaryTag::splitLarge):
(bmalloc::BoundaryTag::allocate):

  • bmalloc/Chunk.h:
  • bmalloc/Deallocator.cpp:

(bmalloc::Deallocator::processObjectLog):
(bmalloc::Deallocator::deallocateSlowCase):

  • bmalloc/Deallocator.h:

(bmalloc::Deallocator::deallocateFastCase):

  • bmalloc/FixedVector.h:

(bmalloc::Capacity>::operator):
(bmalloc::Capacity>::push):
(bmalloc::Capacity>::pop):
(bmalloc::Capacity>::shrink):

  • bmalloc/Heap.cpp:

(bmalloc::Heap::allocateLarge):

  • bmalloc/LargeChunk.h:

(bmalloc::LargeChunk::get):
(bmalloc::LargeChunk::endTag):

  • bmalloc/Line.h:

(bmalloc::Line<Traits>::concurrentRef):
(bmalloc::Line<Traits>::deref):

  • bmalloc/MediumAllocator.h:

(bmalloc::MediumAllocator::allocate):

  • bmalloc/ObjectType.h:

(bmalloc::isSmall):

  • bmalloc/Page.h:

(bmalloc::Page<Traits>::ref):
(bmalloc::Page<Traits>::deref):

  • bmalloc/PerThread.h:

(bmalloc::PerThread<T>::getSlowCase):

  • bmalloc/SegregatedFreeList.cpp:

(bmalloc::SegregatedFreeList::SegregatedFreeList):
(bmalloc::SegregatedFreeList::insert):

  • bmalloc/SmallAllocator.h:

(bmalloc::SmallAllocator::allocate):
(bmalloc::SmallAllocator::refill):

  • bmalloc/Syscall.h:
  • bmalloc/VMAllocate.h:

(bmalloc::vmValidate):
(bmalloc::vmAllocate):
(bmalloc::vmDeallocatePhysicalPagesSloppy):

  • bmalloc/Vector.h:

(bmalloc::Vector<T>::operator):
(bmalloc::Vector<T>::pop):
(bmalloc::Vector<T>::shrink):

  • bmalloc/XLargeChunk.h:

(bmalloc::XLargeChunk::range):
(bmalloc::XLargeChunk::size):

Location:
trunk/Source/bmalloc
Files:
24 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/bmalloc/ChangeLog

    r166944 r166956  
     12014-04-08  Geoffrey Garen  <ggaren@apple.com>
     2
     3        Made bmalloc more #include friendly
     4        https://bugs.webkit.org/show_bug.cgi?id=131386
     5
     6        Reviewed by Andreas Kling.
     7
     8        Marked a bunch of headers private so they can be used from client code
     9        that #includes bmalloc.h.
     10
     11        Renamed ASSERT macros to BASSERT. This matches their header, which already
     12        had to be renamed, and fixes conflicts with WTF's ASSERT macros.
     13
     14        * bmalloc.xcodeproj/project.pbxproj:
     15        * bmalloc/Allocator.cpp:
     16        (bmalloc::Allocator::allocateSlowCase):
     17        * bmalloc/AsyncTask.h:
     18        (bmalloc::Function>::runSlowCase):
     19        * bmalloc/BAssert.h:
     20        * bmalloc/BoundaryTag.h:
     21        (bmalloc::BoundaryTag::setSize):
     22        * bmalloc/BoundaryTagInlines.h:
     23        (bmalloc::validate):
     24        (bmalloc::BoundaryTag::init):
     25        (bmalloc::BoundaryTag::deallocate):
     26        (bmalloc::BoundaryTag::splitLarge):
     27        (bmalloc::BoundaryTag::allocate):
     28        * bmalloc/Chunk.h:
     29        * bmalloc/Deallocator.cpp:
     30        (bmalloc::Deallocator::processObjectLog):
     31        (bmalloc::Deallocator::deallocateSlowCase):
     32        * bmalloc/Deallocator.h:
     33        (bmalloc::Deallocator::deallocateFastCase):
     34        * bmalloc/FixedVector.h:
     35        (bmalloc::Capacity>::operator):
     36        (bmalloc::Capacity>::push):
     37        (bmalloc::Capacity>::pop):
     38        (bmalloc::Capacity>::shrink):
     39        * bmalloc/Heap.cpp:
     40        (bmalloc::Heap::allocateLarge):
     41        * bmalloc/LargeChunk.h:
     42        (bmalloc::LargeChunk::get):
     43        (bmalloc::LargeChunk::endTag):
     44        * bmalloc/Line.h:
     45        (bmalloc::Line<Traits>::concurrentRef):
     46        (bmalloc::Line<Traits>::deref):
     47        * bmalloc/MediumAllocator.h:
     48        (bmalloc::MediumAllocator::allocate):
     49        * bmalloc/ObjectType.h:
     50        (bmalloc::isSmall):
     51        * bmalloc/Page.h:
     52        (bmalloc::Page<Traits>::ref):
     53        (bmalloc::Page<Traits>::deref):
     54        * bmalloc/PerThread.h:
     55        (bmalloc::PerThread<T>::getSlowCase):
     56        * bmalloc/SegregatedFreeList.cpp:
     57        (bmalloc::SegregatedFreeList::SegregatedFreeList):
     58        (bmalloc::SegregatedFreeList::insert):
     59        * bmalloc/SmallAllocator.h:
     60        (bmalloc::SmallAllocator::allocate):
     61        (bmalloc::SmallAllocator::refill):
     62        * bmalloc/Syscall.h:
     63        * bmalloc/VMAllocate.h:
     64        (bmalloc::vmValidate):
     65        (bmalloc::vmAllocate):
     66        (bmalloc::vmDeallocatePhysicalPagesSloppy):
     67        * bmalloc/Vector.h:
     68        (bmalloc::Vector<T>::operator):
     69        (bmalloc::Vector<T>::pop):
     70        (bmalloc::Vector<T>::shrink):
     71        * bmalloc/XLargeChunk.h:
     72        (bmalloc::XLargeChunk::range):
     73        (bmalloc::XLargeChunk::size):
     74
    1752014-04-08  Geoffrey Garen  <ggaren@apple.com>
    276
  • trunk/Source/bmalloc/bmalloc.xcodeproj/project.pbxproj

    r166910 r166956  
    1111                1448C30118F3754C00502839 /* bmalloc.h in Headers */ = {isa = PBXBuildFile; fileRef = 1448C2FE18F3754300502839 /* bmalloc.h */; settings = {ATTRIBUTES = (Private, ); }; };
    1212                14CC394C18EA8858004AFE34 /* libbmalloc.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 14F271BE18EA3963008C152F /* libbmalloc.a */; };
     13                14DD788C18F48CAE00950702 /* LargeChunk.h in Headers */ = {isa = PBXBuildFile; fileRef = 147AAA8818CD17CE002201E4 /* LargeChunk.h */; settings = {ATTRIBUTES = (Private, ); }; };
     14                14DD788D18F48CC600950702 /* BeginTag.h in Headers */ = {isa = PBXBuildFile; fileRef = 1417F64518B54A700076FA3F /* BeginTag.h */; settings = {ATTRIBUTES = (Private, ); }; };
     15                14DD788E18F48CCD00950702 /* BoundaryTag.h in Headers */ = {isa = PBXBuildFile; fileRef = 1485655E18A43AF900ED6942 /* BoundaryTag.h */; settings = {ATTRIBUTES = (Private, ); }; };
     16                14DD789018F48CEB00950702 /* Sizes.h in Headers */ = {isa = PBXBuildFile; fileRef = 145F6874179DF84100D65598 /* Sizes.h */; settings = {ATTRIBUTES = (Private, ); }; };
     17                14DD789218F48CFC00950702 /* EndTag.h in Headers */ = {isa = PBXBuildFile; fileRef = 1417F64618B54A700076FA3F /* EndTag.h */; settings = {ATTRIBUTES = (Private, ); }; };
     18                14DD789318F48D0F00950702 /* ObjectType.h in Headers */ = {isa = PBXBuildFile; fileRef = 1485656018A43DBA00ED6942 /* ObjectType.h */; settings = {ATTRIBUTES = (Private, ); }; };
     19                14DD789818F48D4A00950702 /* Allocator.h in Headers */ = {isa = PBXBuildFile; fileRef = 145F6856179DC8CA00D65598 /* Allocator.h */; settings = {ATTRIBUTES = (Private, ); }; };
     20                14DD789918F48D4A00950702 /* Cache.h in Headers */ = {isa = PBXBuildFile; fileRef = 144469E517A46BFE00F9EA1D /* Cache.h */; settings = {ATTRIBUTES = (Private, ); }; };
     21                14DD789A18F48D4A00950702 /* Deallocator.h in Headers */ = {isa = PBXBuildFile; fileRef = 145F685A179DC90200D65598 /* Deallocator.h */; settings = {ATTRIBUTES = (Private, ); }; };
     22                14DD789B18F48D4A00950702 /* MediumAllocator.h in Headers */ = {isa = PBXBuildFile; fileRef = 1413E47018A0661700546D68 /* MediumAllocator.h */; settings = {ATTRIBUTES = (Private, ); }; };
     23                14DD789C18F48D4A00950702 /* SmallAllocator.h in Headers */ = {isa = PBXBuildFile; fileRef = 1413E462189DE1CD00546D68 /* SmallAllocator.h */; settings = {ATTRIBUTES = (Private, ); }; };
     24                14DD78B418F48D6B00950702 /* Chunk.h in Headers */ = {isa = PBXBuildFile; fileRef = 147AAA9418CE5CA6002201E4 /* Chunk.h */; settings = {ATTRIBUTES = (Private, ); }; };
     25                14DD78B518F48D6B00950702 /* Line.h in Headers */ = {isa = PBXBuildFile; fileRef = 14DA32071885F9E6007269E0 /* Line.h */; settings = {ATTRIBUTES = (Private, ); }; };
     26                14DD78B618F48D6B00950702 /* MediumChunk.h in Headers */ = {isa = PBXBuildFile; fileRef = 147AAA8E18CD89E3002201E4 /* MediumChunk.h */; settings = {ATTRIBUTES = (Private, ); }; };
     27                14DD78B718F48D6B00950702 /* MediumLine.h in Headers */ = {isa = PBXBuildFile; fileRef = 1452478518BC757C00F80098 /* MediumLine.h */; settings = {ATTRIBUTES = (Private, ); }; };
     28                14DD78B818F48D6B00950702 /* MediumPage.h in Headers */ = {isa = PBXBuildFile; fileRef = 143E29E918CAE8BE00FE8A0F /* MediumPage.h */; settings = {ATTRIBUTES = (Private, ); }; };
     29                14DD78B918F48D6B00950702 /* MediumTraits.h in Headers */ = {isa = PBXBuildFile; fileRef = 147AAA9618CE5FB6002201E4 /* MediumTraits.h */; settings = {ATTRIBUTES = (Private, ); }; };
     30                14DD78BA18F48D6B00950702 /* Page.h in Headers */ = {isa = PBXBuildFile; fileRef = 146BEE2318C980D60002D5A2 /* Page.h */; settings = {ATTRIBUTES = (Private, ); }; };
     31                14DD78BB18F48D6B00950702 /* SmallChunk.h in Headers */ = {isa = PBXBuildFile; fileRef = 147AAA8C18CD36A7002201E4 /* SmallChunk.h */; settings = {ATTRIBUTES = (Private, ); }; };
     32                14DD78BC18F48D6B00950702 /* SmallLine.h in Headers */ = {isa = PBXBuildFile; fileRef = 1452478618BC757C00F80098 /* SmallLine.h */; settings = {ATTRIBUTES = (Private, ); }; };
     33                14DD78BD18F48D6B00950702 /* SmallPage.h in Headers */ = {isa = PBXBuildFile; fileRef = 143E29ED18CAE90500FE8A0F /* SmallPage.h */; settings = {ATTRIBUTES = (Private, ); }; };
     34                14DD78BE18F48D6B00950702 /* SmallTraits.h in Headers */ = {isa = PBXBuildFile; fileRef = 147AAA9718CE5FB6002201E4 /* SmallTraits.h */; settings = {ATTRIBUTES = (Private, ); }; };
     35                14DD78C518F48D7500950702 /* Algorithm.h in Headers */ = {isa = PBXBuildFile; fileRef = 1421A87718EE462A00B4DD68 /* Algorithm.h */; settings = {ATTRIBUTES = (Private, ); }; };
     36                14DD78C618F48D7500950702 /* AsyncTask.h in Headers */ = {isa = PBXBuildFile; fileRef = 1417F65218BA88A00076FA3F /* AsyncTask.h */; settings = {ATTRIBUTES = (Private, ); }; };
     37                14DD78C718F48D7500950702 /* BAssert.h in Headers */ = {isa = PBXBuildFile; fileRef = 1413E468189EEDE400546D68 /* BAssert.h */; settings = {ATTRIBUTES = (Private, ); }; };
     38                14DD78C818F48D7500950702 /* FixedVector.h in Headers */ = {isa = PBXBuildFile; fileRef = 14D9DB4517F2447100EAAB79 /* FixedVector.h */; settings = {ATTRIBUTES = (Private, ); }; };
     39                14DD78C918F48D7500950702 /* Inline.h in Headers */ = {isa = PBXBuildFile; fileRef = 1413E460189DCE1E00546D68 /* Inline.h */; settings = {ATTRIBUTES = (Private, ); }; };
     40                14DD78CA18F48D7500950702 /* Mutex.h in Headers */ = {isa = PBXBuildFile; fileRef = 144DCED617A649D90093B2F2 /* Mutex.h */; settings = {ATTRIBUTES = (Private, ); }; };
     41                14DD78CB18F48D7500950702 /* PerProcess.h in Headers */ = {isa = PBXBuildFile; fileRef = 14446A0717A61FA400F9EA1D /* PerProcess.h */; settings = {ATTRIBUTES = (Private, ); }; };
     42                14DD78CC18F48D7500950702 /* PerThread.h in Headers */ = {isa = PBXBuildFile; fileRef = 144469FD17A61F1F00F9EA1D /* PerThread.h */; settings = {ATTRIBUTES = (Private, ); }; };
     43                14DD78CD18F48D7500950702 /* Range.h in Headers */ = {isa = PBXBuildFile; fileRef = 145F6878179E3A4400D65598 /* Range.h */; settings = {ATTRIBUTES = (Private, ); }; };
     44                14DD78CE18F48D7500950702 /* Syscall.h in Headers */ = {isa = PBXBuildFile; fileRef = 1417F64F18B7280C0076FA3F /* Syscall.h */; settings = {ATTRIBUTES = (Private, ); }; };
     45                14DD78CF18F48D7500950702 /* Vector.h in Headers */ = {isa = PBXBuildFile; fileRef = 1479E21217A1A255006D4E9D /* Vector.h */; settings = {ATTRIBUTES = (Private, ); }; };
     46                14DD78D018F48D7500950702 /* VMAllocate.h in Headers */ = {isa = PBXBuildFile; fileRef = 1479E21417A1A63E006D4E9D /* VMAllocate.h */; settings = {ATTRIBUTES = (Private, ); }; };
     47                14DD78D118F48EC600950702 /* XLargeChunk.h in Headers */ = {isa = PBXBuildFile; fileRef = 147AAA8918CD17CE002201E4 /* XLargeChunk.h */; settings = {ATTRIBUTES = (Private, ); }; };
    1348                14F271C318EA3978008C152F /* Allocator.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 145F6855179DC8CA00D65598 /* Allocator.cpp */; };
    1449                14F271C418EA397B008C152F /* Cache.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 144469E417A46BFE00F9EA1D /* Cache.cpp */; };
     
    249284                        buildActionMask = 2147483647;
    250285                        files = (
     286                                14DD78B518F48D6B00950702 /* Line.h in Headers */,
     287                                14DD78CF18F48D7500950702 /* Vector.h in Headers */,
     288                                14DD788C18F48CAE00950702 /* LargeChunk.h in Headers */,
     289                                14DD789218F48CFC00950702 /* EndTag.h in Headers */,
     290                                14DD78CC18F48D7500950702 /* PerThread.h in Headers */,
     291                                14DD78B418F48D6B00950702 /* Chunk.h in Headers */,
     292                                14DD78CA18F48D7500950702 /* Mutex.h in Headers */,
     293                                14DD78D118F48EC600950702 /* XLargeChunk.h in Headers */,
     294                                14DD78B918F48D6B00950702 /* MediumTraits.h in Headers */,
    251295                                1448C30118F3754C00502839 /* bmalloc.h in Headers */,
     296                                14DD789A18F48D4A00950702 /* Deallocator.h in Headers */,
     297                                14DD788D18F48CC600950702 /* BeginTag.h in Headers */,
     298                                14DD78CD18F48D7500950702 /* Range.h in Headers */,
     299                                14DD789C18F48D4A00950702 /* SmallAllocator.h in Headers */,
     300                                14DD789918F48D4A00950702 /* Cache.h in Headers */,
     301                                14DD789B18F48D4A00950702 /* MediumAllocator.h in Headers */,
     302                                14DD78BE18F48D6B00950702 /* SmallTraits.h in Headers */,
     303                                14DD789018F48CEB00950702 /* Sizes.h in Headers */,
     304                                14DD78C718F48D7500950702 /* BAssert.h in Headers */,
     305                                14DD78D018F48D7500950702 /* VMAllocate.h in Headers */,
     306                                14DD78CE18F48D7500950702 /* Syscall.h in Headers */,
     307                                14DD78C618F48D7500950702 /* AsyncTask.h in Headers */,
     308                                14DD78BA18F48D6B00950702 /* Page.h in Headers */,
     309                                14DD78BB18F48D6B00950702 /* SmallChunk.h in Headers */,
     310                                14DD78C918F48D7500950702 /* Inline.h in Headers */,
     311                                14DD78B818F48D6B00950702 /* MediumPage.h in Headers */,
     312                                14DD78C518F48D7500950702 /* Algorithm.h in Headers */,
     313                                14DD78BD18F48D6B00950702 /* SmallPage.h in Headers */,
     314                                14DD788E18F48CCD00950702 /* BoundaryTag.h in Headers */,
     315                                14DD78C818F48D7500950702 /* FixedVector.h in Headers */,
     316                                14DD78B718F48D6B00950702 /* MediumLine.h in Headers */,
     317                                14DD78B618F48D6B00950702 /* MediumChunk.h in Headers */,
     318                                14DD78BC18F48D6B00950702 /* SmallLine.h in Headers */,
     319                                14DD789818F48D4A00950702 /* Allocator.h in Headers */,
     320                                14DD78CB18F48D7500950702 /* PerProcess.h in Headers */,
     321                                14DD789318F48D0F00950702 /* ObjectType.h in Headers */,
    252322                        );
    253323                        runOnlyForDeploymentPostprocessing = 0;
  • trunk/Source/bmalloc/bmalloc/Allocator.cpp

    r166897 r166956  
    138138IF_DEBUG(
    139139    void* dummy;
    140     ASSERT(!allocateFastCase(size, dummy));
     140    BASSERT(!allocateFastCase(size, dummy));
    141141)
    142142    if (size <= smallMax) {
  • trunk/Source/bmalloc/bmalloc/AsyncTask.h

    r166910 r166956  
    110110    }
    111111
    112     ASSERT(oldState == Exited);
     112    BASSERT(oldState == Exited);
    113113    pthread_create(&m_thread, nullptr, &pthreadEntryPoint, this);
    114114    pthread_detach(m_thread);
  • trunk/Source/bmalloc/bmalloc/BAssert.h

    r166910 r166956  
    2727#define BAssert_h
    2828
    29 #define ASSERT_IMPL(x) do { \
     29#define BASSERT_IMPL(x) do { \
    3030    if (!(x)) \
    3131        *(int*)0xbbadbeef = 0; \
    3232} while(0);
    3333
    34 #define RELEASE_ASSERT(x) ASSERT_IMPL(x)
     34#define RELEASE_BASSERT(x) BASSERT_IMPL(x)
    3535
    3636#define UNUSED(x) (void)x
     
    4040#if defined(NDEBUG)
    4141
    42 #define ASSERT(x)
     42#define BASSERT(x)
    4343
    4444#define IF_DEBUG(x...)
     
    5151#if !defined(NDEBUG)
    5252
    53 #define ASSERT(x) ASSERT_IMPL(x)
     53#define BASSERT(x) BASSERT_IMPL(x)
    5454
    5555#define IF_DEBUG(x...) x
  • trunk/Source/bmalloc/bmalloc/BoundaryTag.h

    r166893 r166956  
    8686{
    8787    m_size = static_cast<unsigned>(size);
    88     ASSERT(this->size() == size);
    89     ASSERT(!isXLarge());
     88    BASSERT(this->size() == size);
     89    BASSERT(!isXLarge());
    9090}
    9191
  • trunk/Source/bmalloc/bmalloc/BoundaryTagInlines.h

    r166910 r166956  
    4242    EndTag* endTag = LargeChunk::endTag(range.begin(), range.size());
    4343
    44     ASSERT(!beginTag->isEnd());
     44    BASSERT(!beginTag->isEnd());
    4545    if (beginTag->isXLarge())
    4646        return;
    4747)
    48     ASSERT(range.size() >= largeMin);
    49     ASSERT(beginTag->size() == range.size());
    50 
    51     ASSERT(beginTag->size() == endTag->size());
    52     ASSERT(beginTag->isFree() == endTag->isFree());
    53     ASSERT(beginTag->hasPhysicalPages() == endTag->hasPhysicalPages());
    54     ASSERT(beginTag->isXLarge() == endTag->isXLarge());
    55     ASSERT(static_cast<BoundaryTag*>(endTag) == static_cast<BoundaryTag*>(beginTag) || endTag->isEnd());
     48    BASSERT(range.size() >= largeMin);
     49    BASSERT(beginTag->size() == range.size());
     50
     51    BASSERT(beginTag->size() == endTag->size());
     52    BASSERT(beginTag->isFree() == endTag->isFree());
     53    BASSERT(beginTag->hasPhysicalPages() == endTag->hasPhysicalPages());
     54    BASSERT(beginTag->isXLarge() == endTag->isXLarge());
     55    BASSERT(static_cast<BoundaryTag*>(endTag) == static_cast<BoundaryTag*>(beginTag) || endTag->isEnd());
    5656}
    5757
     
    9797   
    9898    EndTag* leftSentinel = beginTag->prev();
    99     ASSERT(leftSentinel >= static_cast<void*>(chunk));
     99    BASSERT(leftSentinel >= static_cast<void*>(chunk));
    100100    leftSentinel->setSize(largeMin);
    101101    leftSentinel->setFree(false);
    102102
    103103    BeginTag* rightSentinel = endTag->next();
    104     ASSERT(rightSentinel < static_cast<void*>(range.begin()));
     104    BASSERT(rightSentinel < static_cast<void*>(range.begin()));
    105105    rightSentinel->setSize(largeMin);
    106106    rightSentinel->setFree(false);
     
    164164{
    165165    BeginTag* beginTag = LargeChunk::beginTag(object);
    166     ASSERT(!beginTag->isFree());
    167     ASSERT(!beginTag->isXLarge())
     166    BASSERT(!beginTag->isFree());
     167    BASSERT(!beginTag->isXLarge())
    168168
    169169    Range range(object, beginTag->size());
     
    183183
    184184    leftover = Range(range.begin() + size, range.size() - size);
    185     ASSERT(leftover.size() >= largeMin);
     185    BASSERT(leftover.size() >= largeMin);
    186186    BeginTag* leftoverBeginTag = LargeChunk::beginTag(leftover.begin());
    187187    *leftoverBeginTag = *beginTag;
     
    203203    EndTag* endTag = LargeChunk::endTag(range.begin(), range.size());
    204204
    205     ASSERT(beginTag->isFree());
     205    BASSERT(beginTag->isFree());
    206206    validate(beginTag->prev(), range, endTag->next());
    207207
  • trunk/Source/bmalloc/bmalloc/Chunk.h

    r166893 r166956  
    7878inline auto Chunk<Traits>::get(void* object) -> Chunk*
    7979{
    80     ASSERT(isSmallOrMedium(object));
     80    BASSERT(isSmallOrMedium(object));
    8181    return static_cast<Chunk*>(mask(object, chunkMask));
    8282}
  • trunk/Source/bmalloc/bmalloc/Deallocator.cpp

    r166898 r166956  
    8282            deallocateSmallLine(lock, line);
    8383        } else {
    84             ASSERT(isSmallOrMedium(object));
     84            BASSERT(isSmallOrMedium(object));
    8585            MediumLine* line = MediumLine::get(object);
    8686            if (!line->deref(lock))
     
    9595void Deallocator::deallocateSlowCase(void* object)
    9696{
    97     ASSERT(!deallocateFastCase(object));
     97    BASSERT(!deallocateFastCase(object));
    9898
    9999    if (!object)
  • trunk/Source/bmalloc/bmalloc/Deallocator.h

    r166897 r166956  
    6666        return false;
    6767
    68     ASSERT(object);
     68    BASSERT(object);
    6969
    7070    if (m_objectLog.size() == m_objectLog.capacity())
  • trunk/Source/bmalloc/bmalloc/FixedVector.h

    r166893 r166956  
    7777inline T& FixedVector<T, Capacity>::operator[](size_t i)
    7878{
    79     ASSERT(i < m_size);
     79    BASSERT(i < m_size);
    8080    return m_buffer[i];
    8181}
     
    8484inline void FixedVector<T, Capacity>::push(const T& value)
    8585{
    86     ASSERT(m_size < Capacity);
     86    BASSERT(m_size < Capacity);
    8787    m_buffer[m_size++] = value;
    8888}
     
    9898inline T FixedVector<T, Capacity>::pop()
    9999{
    100     ASSERT(m_size);
     100    BASSERT(m_size);
    101101    return m_buffer[--m_size];
    102102}
     
    105105inline void FixedVector<T, Capacity>::shrink(size_t size)
    106106{
    107     ASSERT(size <= m_size);
     107    BASSERT(size <= m_size);
    108108    m_size = size;
    109109}
  • trunk/Source/bmalloc/bmalloc/Heap.cpp

    r166910 r166956  
    171171void* Heap::allocateLarge(std::lock_guard<Mutex>&, size_t size)
    172172{
    173     ASSERT(size <= largeMax);
    174     ASSERT(size >= largeMin);
     173    BASSERT(size <= largeMax);
     174    BASSERT(size >= largeMin);
    175175   
    176176    m_isAllocatingPages = true;
  • trunk/Source/bmalloc/bmalloc/LargeChunk.h

    r166893 r166956  
    7777inline LargeChunk* LargeChunk::get(void* object)
    7878{
    79     ASSERT(!isSmallOrMedium(object));
     79    BASSERT(!isSmallOrMedium(object));
    8080    return static_cast<LargeChunk*>(mask(object, largeChunkMask));
    8181}
     
    9090inline EndTag* LargeChunk::endTag(void* object, size_t size)
    9191{
    92     ASSERT(!isSmallOrMedium(object));
     92    BASSERT(!isSmallOrMedium(object));
    9393
    9494    LargeChunk* chunk = get(object);
  • trunk/Source/bmalloc/bmalloc/Line.h

    r166897 r166956  
    5959inline auto Line<Traits>::get(void* object) -> Line*
    6060{
    61     ASSERT(isSmallOrMedium(object));
     61    BASSERT(isSmallOrMedium(object));
    6262    Chunk* chunk = Chunk::get(object);
    6363    size_t lineNumber = (reinterpret_cast<char*>(object) - reinterpret_cast<char*>(chunk)) / lineSize;
     
    8383inline void Line<Traits>::concurrentRef(unsigned char count)
    8484{
    85     ASSERT(!m_refCount); // Up-ref from zero can be lock-free because there are no other clients.
    86     ASSERT(count <= maxRefCount);
     85    BASSERT(!m_refCount); // Up-ref from zero can be lock-free because there are no other clients.
     86    BASSERT(count <= maxRefCount);
    8787    m_refCount = count;
    8888}
     
    9191inline bool Line<Traits>::deref(std::lock_guard<Mutex>&, unsigned char count)
    9292{
    93     ASSERT(count <= m_refCount);
     93    BASSERT(count <= m_refCount);
    9494    m_refCount -= count;
    9595    return !m_refCount;
  • trunk/Source/bmalloc/bmalloc/MediumAllocator.h

    r166893 r166956  
    6868inline void* MediumAllocator::allocate(size_t size)
    6969{
    70     ASSERT(size <= m_remaining);
    71     ASSERT(size == roundUpToMultipleOf<alignment>(size));
    72     ASSERT(size >= MediumLine::minimumObjectSize);
     70    BASSERT(size <= m_remaining);
     71    BASSERT(size == roundUpToMultipleOf<alignment>(size));
     72    BASSERT(size >= MediumLine::minimumObjectSize);
    7373
    7474    m_remaining -= size;
    7575    void* object = m_end - m_remaining - size;
    76     ASSERT(isSmallOrMedium(object) && !isSmall(object));
     76    BASSERT(isSmallOrMedium(object) && !isSmall(object));
    7777
    7878    ++m_objectCount;
  • trunk/Source/bmalloc/bmalloc/ObjectType.h

    r166893 r166956  
    4343inline bool isSmall(void* smallOrMedium)
    4444{
    45     ASSERT(isSmallOrMedium(smallOrMedium));
     45    BASSERT(isSmallOrMedium(smallOrMedium));
    4646    return test(smallOrMedium, smallOrMediumSmallTypeMask);
    4747}
  • trunk/Source/bmalloc/bmalloc/Page.h

    r166897 r166956  
    6060inline void Page<Traits>::ref(std::lock_guard<Mutex>&)
    6161{
    62     ASSERT(m_refCount < maxRefCount);
     62    BASSERT(m_refCount < maxRefCount);
    6363    ++m_refCount;
    6464}
     
    6767inline bool Page<Traits>::deref(std::lock_guard<Mutex>&)
    6868{
    69     ASSERT(m_refCount);
     69    BASSERT(m_refCount);
    7070    --m_refCount;
    7171    return !m_refCount;
  • trunk/Source/bmalloc/bmalloc/PerThread.h

    r166893 r166956  
    118118T* PerThread<T>::getSlowCase()
    119119{
    120     ASSERT(!getFastCase());
     120    BASSERT(!getFastCase());
    121121    T* t = new T;
    122122    PerThreadStorage<T>::init(t, destructor);
  • trunk/Source/bmalloc/bmalloc/SegregatedFreeList.cpp

    r166910 r166956  
    3333SegregatedFreeList::SegregatedFreeList()
    3434{
    35     ASSERT(static_cast<size_t>(&select(largeMax) - m_lists.begin()) == m_lists.size() - 1);
     35    BASSERT(static_cast<size_t>(&select(largeMax) - m_lists.begin()) == m_lists.size() - 1);
    3636}
    3737
     
    4040IF_DEBUG(
    4141    BeginTag* beginTag = LargeChunk::beginTag(range.begin());
    42     ASSERT(beginTag->isInFreeList(range.size()));
     42    BASSERT(beginTag->isInFreeList(range.size()));
    4343)
    4444
  • trunk/Source/bmalloc/bmalloc/SmallAllocator.h

    r166893 r166956  
    8080inline void* SmallAllocator::allocate()
    8181{
    82     ASSERT(m_remaining);
    83     ASSERT(m_size >= SmallLine::minimumObjectSize);
     82    BASSERT(m_remaining);
     83    BASSERT(m_size >= SmallLine::minimumObjectSize);
    8484
    8585    --m_remaining;
    8686    char* result = m_ptr;
    8787    m_ptr += m_size;
    88     ASSERT(isSmall(result));
     88    BASSERT(isSmall(result));
    8989    return result;
    9090}
     
    102102inline void SmallAllocator::refill(SmallLine* line)
    103103{
    104     ASSERT(!canAllocate());
     104    BASSERT(!canAllocate());
    105105    line->concurrentRef(SmallLine::maxRefCount);
    106106    m_ptr = line->begin();
  • trunk/Source/bmalloc/bmalloc/Syscall.h

    r166893 r166956  
    3131#define SYSCALL(x) do { \
    3232    while ((x) == -1) \
    33         RELEASE_ASSERT(errno == EAGAIN); \
     33        RELEASE_BASSERT(errno == EAGAIN); \
    3434} while (0);
    3535
  • trunk/Source/bmalloc/bmalloc/VMAllocate.h

    r166910 r166956  
    5151{
    5252    UNUSED(vmSize);
    53     ASSERT(vmSize);
    54     ASSERT(vmSize == bmalloc::vmSize(vmSize));
     53    BASSERT(vmSize);
     54    BASSERT(vmSize == bmalloc::vmSize(vmSize));
    5555}
    5656
     
    6262    // allowed to be larger than the OS's true page size.
    6363    UNUSED(p);
    64     ASSERT(p);
    65     ASSERT(p == mask(p, ~(getpagesize() - 1)));
     64    BASSERT(p);
     65    BASSERT(p == mask(p, ~(getpagesize() - 1)));
    6666}
    6767
     
    8484{
    8585    vmValidate(vmSize);
    86     ASSERT(isPowerOfTwo(alignment));
     86    BASSERT(isPowerOfTwo(alignment));
    8787
    8888    size_t mappedSize = std::max(vmSize, alignment) + alignment;
     
    119119inline void vmDeallocatePhysicalPagesSloppy(void* p, size_t size)
    120120{
    121     ASSERT(size >= vmPageSize);
     121    BASSERT(size >= vmPageSize);
    122122
    123123    char* begin = roundUpToMultipleOf<vmPageSize>(static_cast<char*>(p));
  • trunk/Source/bmalloc/bmalloc/Vector.h

    r166893 r166956  
    9595inline T& Vector<T>::operator[](size_t i)
    9696{
    97     ASSERT(i < m_size);
     97    BASSERT(i < m_size);
    9898    return m_buffer[i];
    9999}
     
    120120inline T Vector<T>::pop()
    121121{
    122     ASSERT(m_size);
     122    BASSERT(m_size);
    123123    T value = m_buffer[m_size - 1];
    124124    shrink(m_size - 1);
     
    129129inline T Vector<T>::pop(size_t i)
    130130{
    131     ASSERT(i < m_size);
     131    BASSERT(i < m_size);
    132132    std::swap(m_buffer[i], last());
    133133    return pop();
     
    137137inline void Vector<T>::shrink(size_t size)
    138138{
    139     ASSERT(size <= m_size);
     139    BASSERT(size <= m_size);
    140140    m_size = size;
    141141    if (m_capacity > initialCapacity && m_size < m_capacity / shrinkFactor)
  • trunk/Source/bmalloc/bmalloc/XLargeChunk.h

    r166893 r166956  
    7272    // can stuff our range into the remaining metadata.
    7373    Range& result = *reinterpret_cast<Range*>(roundUpToMultipleOf<alignment>(LargeChunk::beginTag(begin()) + 1));
    74     ASSERT(static_cast<void*>(&result) < static_cast<void*>(begin()));
     74    BASSERT(static_cast<void*>(&result) < static_cast<void*>(begin()));
    7575    return result;
    7676}
     
    8181    // can stuff our size into the remaining metadata.
    8282    size_t& result = *reinterpret_cast<size_t*>(roundUpToMultipleOf<alignment>(&range() + 1));
    83     ASSERT(static_cast<void*>(&result) < static_cast<void*>(begin()));
     83    BASSERT(static_cast<void*>(&result) < static_cast<void*>(begin()));
    8484    return result;
    8585}
Note: See TracChangeset for help on using the changeset viewer.