mirror of
https://github.com/matrix-construct/construct
synced 2024-12-25 23:14:13 +01:00
ircd::fs::map: Add ergonomic trailing-opts ctor.
This commit is contained in:
parent
b815ac8bec
commit
56bbc04527
2 changed files with 10 additions and 2 deletions
|
@ -34,6 +34,7 @@ struct ircd::fs::map
|
|||
static const opts default_opts;
|
||||
|
||||
map() = default;
|
||||
explicit map(const fd &, const size_t size, const opts &opts);
|
||||
map(const fd &, const opts &opts = default_opts, const size_t &size = 0UL);
|
||||
map(map &&) noexcept;
|
||||
map(const map &) = delete;
|
||||
|
@ -56,6 +57,13 @@ struct ircd::fs::map::opts
|
|||
bool huge1gb {false};
|
||||
};
|
||||
|
||||
inline
|
||||
ircd::fs::map::map(const fd &fd,
|
||||
const opts &opts,
|
||||
const size_t &size)
|
||||
:map{fd, size, opts}
|
||||
{}
|
||||
|
||||
inline
|
||||
ircd::fs::map::map(map &&other)
|
||||
noexcept
|
||||
|
|
|
@ -2059,8 +2059,8 @@ decltype(ircd::fs::map::default_opts)
|
|||
ircd::fs::map::default_opts;
|
||||
|
||||
ircd::fs::map::map(const fd &fd,
|
||||
const opts &opts,
|
||||
const size_t &size)
|
||||
const size_t size,
|
||||
const opts &opts)
|
||||
#if defined(HAVE_MMAP)
|
||||
{
|
||||
assert(size || int(fd) > -1);
|
||||
|
|
Loading…
Reference in a new issue