xo-alloc2: mark Allocator.expand() noexcept
This commit is contained in:
parent
360ae4cb45
commit
07569add32
5 changed files with 19 additions and 19 deletions
|
|
@ -108,7 +108,7 @@ namespace xo {
|
|||
* to size at least @p z
|
||||
* In practice will round up to a multiple of hugepage size (2MB)
|
||||
**/
|
||||
virtual bool expand(Opaque d, std::size_t z) const = 0;
|
||||
virtual bool expand(Opaque d, std::size_t z) const noexcept = 0;
|
||||
/** allocate @p z bytes of memory from allocator @p d. **/
|
||||
virtual std::byte * alloc(Opaque d, std::size_t z) const = 0;
|
||||
/** reset allocator @p d to empty state **/
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@ namespace xo {
|
|||
[[noreturn]] size_type allocated(Copaque) const noexcept override { _fatal(); }
|
||||
[[noreturn]] bool contains(Copaque, const void *) const noexcept override { _fatal(); }
|
||||
|
||||
[[noreturn]] bool expand(Opaque, std::size_t) const override { _fatal(); }
|
||||
[[noreturn]] bool expand(Opaque, std::size_t) const noexcept override { _fatal(); }
|
||||
[[noreturn]] std::byte * alloc(Opaque, std::size_t) const override { _fatal(); }
|
||||
[[noreturn]] void clear(Opaque) const override { _fatal(); }
|
||||
[[noreturn]] void destruct_data(Opaque) const override { _fatal(); }
|
||||
|
|
|
|||
|
|
@ -30,19 +30,19 @@ namespace xo {
|
|||
struct IAllocator_DArena {
|
||||
using size_type = std::size_t;
|
||||
|
||||
static const std::string & name(const DArena &);
|
||||
static size_type reserved(const DArena &);
|
||||
static size_type size(const DArena &);
|
||||
static size_type committed(const DArena &);
|
||||
static size_type available(const DArena &);
|
||||
static size_type allocated(const DArena &);
|
||||
static bool contains(const DArena &, const void * p);
|
||||
static const std::string & name(const DArena &) noexcept;
|
||||
static size_type reserved(const DArena &) noexcept;
|
||||
static size_type size(const DArena &) noexcept;
|
||||
static size_type committed(const DArena &) noexcept;
|
||||
static size_type available(const DArena &) noexcept;
|
||||
static size_type allocated(const DArena &) noexcept;
|
||||
static bool contains(const DArena &, const void * p) noexcept;
|
||||
|
||||
/** expand committed space in arena @p d
|
||||
* to size at least @p z
|
||||
* In practice will round up to a multiple of @ref page_z_.
|
||||
**/
|
||||
static bool expand(DArena & d, std::size_t z);
|
||||
static bool expand(DArena & d, std::size_t z) noexcept;
|
||||
|
||||
static std::byte * alloc(const DArena &, std::size_t z);
|
||||
static void clear(DArena &);
|
||||
|
|
|
|||
|
|
@ -48,7 +48,7 @@ namespace xo {
|
|||
return Impl::contains(_dcast(d), p);
|
||||
}
|
||||
|
||||
bool expand(Opaque d, std::size_t z) const override {
|
||||
bool expand(Opaque d, std::size_t z) const noexcept override {
|
||||
return Impl::expand(_dcast(d), z);
|
||||
}
|
||||
std::byte * alloc(Opaque d, std::size_t z) const override {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue