diff options
author | Andreas Kling <kling@serenityos.org> | 2021-02-23 20:42:32 +0100 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-02-23 20:56:54 +0100 |
commit | 5d180d1f996ead27f9c5cb3db7f91e293de34d9d (patch) | |
tree | e881854dac5d749518562970d6194a0ef65736ec /Userland/Libraries/LibJS/Heap/HeapBlock.cpp | |
parent | b33a6a443e700cd80325d312f21c985b0687bb97 (diff) | |
download | serenity-5d180d1f996ead27f9c5cb3db7f91e293de34d9d.zip |
Everywhere: Rename ASSERT => VERIFY
(...and ASSERT_NOT_REACHED => VERIFY_NOT_REACHED)
Since all of these checks are done in release builds as well,
let's rename them to VERIFY to prevent confusion, as everyone is
used to assertions being compiled out in release.
We can introduce a new ASSERT macro that is specifically for debug
checks, but I'm doing this wholesale conversion first since we've
accumulated thousands of these already, and it's not immediately
obvious which ones are suitable for ASSERT.
Diffstat (limited to 'Userland/Libraries/LibJS/Heap/HeapBlock.cpp')
-rw-r--r-- | Userland/Libraries/LibJS/Heap/HeapBlock.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/Userland/Libraries/LibJS/Heap/HeapBlock.cpp b/Userland/Libraries/LibJS/Heap/HeapBlock.cpp index 0341eeb243..c250211421 100644 --- a/Userland/Libraries/LibJS/Heap/HeapBlock.cpp +++ b/Userland/Libraries/LibJS/Heap/HeapBlock.cpp @@ -42,7 +42,7 @@ NonnullOwnPtr<HeapBlock> HeapBlock::create_with_cell_size(Heap& heap, size_t cel #else auto* block = (HeapBlock*)aligned_alloc(block_size, block_size); #endif - ASSERT(block != MAP_FAILED); + VERIFY(block != MAP_FAILED); new (block) HeapBlock(heap, cell_size); return NonnullOwnPtr<HeapBlock>(NonnullOwnPtr<HeapBlock>::Adopt, *block); } @@ -51,7 +51,7 @@ void HeapBlock::operator delete(void* ptr) { #ifdef __serenity__ int rc = munmap(ptr, block_size); - ASSERT(rc == 0); + VERIFY(rc == 0); #else free(ptr); #endif @@ -61,7 +61,7 @@ HeapBlock::HeapBlock(Heap& heap, size_t cell_size) : m_heap(heap) , m_cell_size(cell_size) { - ASSERT(cell_size >= sizeof(FreelistEntry)); + VERIFY(cell_size >= sizeof(FreelistEntry)); FreelistEntry* next = nullptr; for (ssize_t i = cell_count() - 1; i >= 0; i--) { @@ -75,10 +75,10 @@ HeapBlock::HeapBlock(Heap& heap, size_t cell_size) void HeapBlock::deallocate(Cell* cell) { - ASSERT(is_valid_cell_pointer(cell)); - ASSERT(!m_freelist || is_valid_cell_pointer(m_freelist)); - ASSERT(cell->is_live()); - ASSERT(!cell->is_marked()); + VERIFY(is_valid_cell_pointer(cell)); + VERIFY(!m_freelist || is_valid_cell_pointer(m_freelist)); + VERIFY(cell->is_live()); + VERIFY(!cell->is_marked()); cell->~Cell(); auto* freelist_entry = new (cell) FreelistEntry(); freelist_entry->set_live(false); |