提交 a0816f0b 编写于 作者: J Jesse Lee

Fix rc

上级 8e06c2fe
......@@ -52,7 +52,7 @@ Status Arena::Allocate(size_t n, void **p) {
// Round up n to 1K block
uint64_t req_size = static_cast<uint64_t>(n) + ARENA_WALL_OVERHEAD_SZ;
if (req_size > this->get_max_size()) {
RETURN_STATUS_UNEXPECTED("Request size too big : " + std::to_string(n));
return Status(StatusCode::kOutOfMemory);
}
uint64_t reqBlk = SizeToBlk(req_size);
// Do a first fit search
......
......@@ -46,7 +46,10 @@ Status IntrpService::Register(const std::string &name, IntrpResource *res) {
std::ostringstream ss;
ss << this_thread::get_id();
MS_LOG(DEBUG) << "Register resource with name " << name << ". Thread ID " << ss.str() << ".";
(void)all_intrp_resources_.emplace(name, res);
auto it = all_intrp_resources_.emplace(name, res);
if (it.second == false) {
return Status(StatusCode::kDuplicateKey, __LINE__, __FILE__, name);
}
high_water_mark_++;
} catch (std::exception &e) {
RETURN_STATUS_UNEXPECTED(e.what());
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册