xo-alloc2: make AAllocator.name() -> string_view
This commit is contained in:
parent
1ac6631d6d
commit
8d0af9a0e3
6 changed files with 6 additions and 6 deletions
|
|
@ -89,7 +89,7 @@ namespace xo {
|
|||
/** optional name for allocator @p d
|
||||
* Labeling, for diagnostics.
|
||||
**/
|
||||
virtual const std::string & name(Copaque d) const noexcept = 0;
|
||||
virtual std::string_view name(Copaque d) const noexcept = 0;
|
||||
/** reserved size in bytes for allocator @p d.
|
||||
* Includes committed + uncommitted memory.
|
||||
* Cannot be increased.
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ namespace xo {
|
|||
// from AAllocator
|
||||
int32_t _typeseq() const noexcept override { return s_typeseq; }
|
||||
|
||||
[[noreturn]] const std::string & name(Copaque) const noexcept override { _fatal(); }
|
||||
[[noreturn]] std::string_view name(Copaque) const noexcept override { _fatal(); }
|
||||
[[noreturn]] size_type reserved(Copaque) const noexcept override { _fatal(); }
|
||||
[[noreturn]] size_type size(Copaque) const noexcept override { _fatal(); }
|
||||
[[noreturn]] size_type committed(Copaque) const noexcept override { _fatal(); }
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ namespace xo {
|
|||
struct IAllocator_DArena {
|
||||
using size_type = std::size_t;
|
||||
|
||||
static const std::string & name(const DArena &) noexcept;
|
||||
static std::string_view 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;
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ namespace xo {
|
|||
// const methods
|
||||
|
||||
int32_t _typeseq() const noexcept override { return s_typeseq; }
|
||||
const std::string & name(Copaque d) const noexcept override { return I::name(_dcast(d)); }
|
||||
std::string_view name(Copaque d) const noexcept override { return I::name(_dcast(d)); }
|
||||
size_type reserved(Copaque d) const noexcept override { return I::reserved(_dcast(d)); }
|
||||
size_type size(Copaque d) const noexcept override { return I::size(_dcast(d)); }
|
||||
size_type committed(Copaque d) const noexcept override { return I::committed(_dcast(d)); }
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ namespace xo {
|
|||
RAllocator(Object::DataPtr data) : Object{std::move(data)} {}
|
||||
|
||||
int32_t _typeseq() const { return O::iface()->_typeseq(); }
|
||||
const std::string & name() const { return O::iface()->name(O::data()); }
|
||||
std::string_view name() const { return O::iface()->name(O::data()); }
|
||||
size_type reserved() const { return O::iface()->reserved(O::data()); }
|
||||
size_type size() const { return O::iface()->size(O::data()); }
|
||||
size_type committed() const { return O::iface()->committed(O::data()); }
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ namespace xo {
|
|||
|
||||
namespace mm {
|
||||
|
||||
const std::string &
|
||||
std::string_view
|
||||
IAllocator_DArena::name(const DArena & s) noexcept {
|
||||
return s.config_.name_;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue