/*
- * Copyright 2013 Facebook, Inc.
+ * Copyright 2016 Facebook, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
}
void* mem = alloc.allocate(allocSize);
- assert(isAligned(mem));
return std::make_pair(new (mem) Block(), allocSize - sizeof(Block));
}
std::pair<Block*, size_t> p;
char* start;
-
size_t allocSize = std::max(size, minBlockSize()) + sizeof(Block);
- if(sizeLimit_ && allocSize > sizeLimit_ - totalAllocatedSize_) {
+ if (sizeLimit_ != kNoSizeLimit &&
+ allocSize > sizeLimit_ - totalAllocatedSize_) {
throw std::bad_alloc();
}