aboutsummaryrefslogtreecommitdiff
path: root/common/memorypool.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'common/memorypool.cpp')
-rw-r--r--common/memorypool.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/common/memorypool.cpp b/common/memorypool.cpp
index 1a9bfe2e29..f0134a430d 100644
--- a/common/memorypool.cpp
+++ b/common/memorypool.cpp
@@ -43,7 +43,7 @@ static size_t adjustChunkSize(size_t chunkSize) {
MemoryPool::MemoryPool(size_t chunkSize)
: _chunkSize(adjustChunkSize(chunkSize)) {
- _next = NULL;
+ _next = nullptr;
_chunksPerPage = INITIAL_CHUNKS_PER_PAGE;
}
@@ -64,7 +64,7 @@ void MemoryPool::allocPage() {
// Allocate a new page
page.numChunks = _chunksPerPage;
- assert(page.numChunks * _chunkSize < 16*1024*1024); // Refuse to allocate pages bigger than 16 MB
+ assert(page.numChunks * _chunkSize < 16*1024*1024); // Refuse to allocate pages bigger than 16 MB
page.start = ::malloc(page.numChunks * _chunkSize);
assert(page.start);
@@ -154,7 +154,7 @@ void MemoryPool::freeUnusedPages() {
::free(_pages[i].start);
++freedPagesCount;
- _pages[i].start = NULL;
+ _pages[i].start = nullptr;
}
}
@@ -163,7 +163,7 @@ void MemoryPool::freeUnusedPages() {
// Remove all now unused pages
size_t newSize = 0;
for (size_t i = 0; i < _pages.size(); ++i) {
- if (_pages[i].start != NULL) {
+ if (_pages[i].start != nullptr) {
if (newSize != i)
_pages[newSize] = _pages[i];
++newSize;