View in context in the libbitcoin Slack #general mirror.
access construction. That's because of the interaction of these two methods, and the fact that access() takes a shared lock until destruct.
size_t map::size() const NOEXCEPT
{
std::shared_lock field_lock(field_mutex_);
return logical_;
}
size_t map::allocate(size_t chunk) NOEXCEPT
{
std::unique_lock field_lock(field_mutex_);
if (!loaded_ || is_add_overflow(logical_, chunk))
return storage::eof;
auto end = logical_ + chunk;
if (end > capacity_)
{
const auto size = to_capacity(end);
std::unique_lock remap_lock(remap_mutex_);
if (!remap_(size))
return storage::eof;
}
std::swap(logical_, end);
return end;
} (edited)