Commit bc8c42bb authored by Yedidya Feldblum's avatar Yedidya Feldblum Committed by Facebook GitHub Bot

use throw_exception in Arena

Summary: Use `throw_exception` consistently in `Arena` for consistency.

Differential Revision: D25637401

fbshipit-source-id: 92cda5acc09b871fed78044fa3f3fa2c41b01609
parent e6955f4d
......@@ -34,7 +34,7 @@ void* Arena<Alloc>::allocateSlow(size_t size) {
}
if (sizeLimit_ != kNoSizeLimit &&
allocSize > sizeLimit_ - totalAllocatedSize_) {
throw_exception(std::bad_alloc());
throw_exception<std::bad_alloc>();
}
if (size > minBlockSize()) {
......
......@@ -74,8 +74,8 @@ class Arena {
sizeLimit_(sizeLimit),
maxAlign_(maxAlign) {
if ((maxAlign_ & (maxAlign_ - 1)) || maxAlign_ > alignof(Block)) {
throw_exception(std::invalid_argument(
folly::to<std::string>("Invalid maxAlign: ", maxAlign_)));
throw_exception<std::invalid_argument>(
folly::to<std::string>("Invalid maxAlign: ", maxAlign_));
}
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment