66# define ALEPH_HAS_MAP_ARENA 1
68# define ALEPH_HAS_MAP_ARENA 0
71#if ALEPH_HAS_MAP_ARENA
84namespace fs = std::filesystem;
174 bool remap(
const size_t sz)
189 <<
"cannot truncate the file to " <<
new_size <<
" error = " <<
errno;
191 rgn_ptr =
static_cast<char*
>(ptr);
200 using iterator =
char *;
203 using const_iterator =
const char *;
227 const auto status = ::read(
fd, &end_,
sizeof(end_));
235 rgn_size =
static_cast<size_t>(file_size);
243 <<
"cannot truncate the file to " <<
rgn_size <<
" error = " <<
errno;
249 <<
"Cannot mmap. Error = " <<
errno;
251 rgn_ptr =
static_cast<char*
>(ptr);
305 other.rgn_ptr =
nullptr;
333 other.rgn_ptr =
nullptr;
373 [[
nodiscard]] const_iterator end()
const noexcept {
return rgn_ptr + end_; }
411 if (sz > avail() && !
remap(sz))
466 [[
nodiscard]]
bool empty()
const noexcept
475 [[
nodiscard]]
bool is_initialized()
const noexcept
493 [[
nodiscard]]
int file_descriptor()
const noexcept
506 return o <<
"MapArena:\n"
507 <<
" rgn_ptr = " <<
static_cast<void*
>(s.rgn_ptr) <<
'\n'
508 <<
" end_ = " << s.end_ <<
'\n'
509 <<
" rgn_size = " << s.rgn_size <<
'\n'
510 <<
" size = " << s.size() <<
'\n'
511 <<
" capacity = " << s.capacity() <<
'\n'
512 <<
" avail = " << s.avail();
Exception handling system with formatted messages for Aleph-w.
#define ah_runtime_error_unless(C)
Throws std::runtime_error if condition does NOT hold.
size_t blossom_maximum_cardinality_matching(const GT &g, DynDlist< typename GT::Arc * > &matching, SA sa=SA())
Alias of compute_maximum_cardinality_general_matching().
Main namespace for Aleph-w library functions.
size_t size(Node *root) noexcept
std::ostream & operator<<(std::ostream &osObject, const Field< T > &rightOp)
static std::atomic< bool > init