pull/982/head
Jesse Lee 5 years ago
parent 8e06c2fe93
commit a0816f0bd6

@ -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());

Loading…
Cancel
Save