Summary:
* folly/IndexedMemPool.h (IndexedMemPool): Correct the test for
failed mmap. Upon failure, it returns MAP_FAILED, not nullptr.
Test Plan:
fbconfig -r folly/test:indexed_mem_pool_test && fbmake runtests
Reviewed By: ngbronson@fb.com
FB internal diff:
D1480389
Tasks:
4846893
@override-unit-failures
slots_ = static_cast<Slot*>(mmap(nullptr, mmapLength_,
PROT_READ | PROT_WRITE,
MAP_PRIVATE | MAP_ANONYMOUS, -1, 0));
- if (slots_ == nullptr) {
+ if (slots_ == MAP_FAILED) {
assert(errno == ENOMEM);
throw std::bad_alloc();
}