diff options
| -rw-r--r-- | src/memory.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/memory.cpp b/src/memory.cpp index 3f5de65..08df8f0 100644 --- a/src/memory.cpp +++ b/src/memory.cpp @@ -34,6 +34,7 @@ int64_t InitNewBucket(int64_t sz, bool transient = false) { bkt.lastEmptyBlockIndex = -1; bkt.maxBlockCount = blockCount < 10 ? 10 : blockCount; bkt.blocks = reinterpret_cast<char *>(std::malloc(sz)); + assert(bkt.blocks != nullptr && "failed to allocate memory"); bkt.ptr = bkt.blocks + (sizeof(MemBlock) * bkt.maxBlockCount); size_t misalignment = reinterpret_cast<uint64_t>(bkt.ptr) % MAXIMUM_ALIGNMENT; if (misalignment != 0) { |
