alloc/raw: add 'data' accessor

This commit is contained in:
Danny Robson 2018-02-28 16:19:27 +11:00
parent 0e3fa05f05
commit 2941a5a3e1
3 changed files with 21 additions and 0 deletions

View File

@ -71,6 +71,9 @@ namespace util::alloc::raw {
///////////////////////////////////////////////////////////////////////
auto data (void) { return m_successor.data (); }
//---------------------------------------------------------------------
auto begin (void) { return m_successor.begin (); }
auto begin (void) const { return m_successor.begin (); }

View File

@ -75,6 +75,22 @@ linear::deallocate (void *ptr, size_t bytes, size_t alignment)
}
//-----------------------------------------------------------------------------
void*
linear::data (void)
{
return m_begin;
}
//-----------------------------------------------------------------------------
const void*
linear::data (void) const
{
return m_begin;
}
//-----------------------------------------------------------------------------
void*
linear::begin (void)

View File

@ -43,10 +43,12 @@ namespace util::alloc::raw {
void deallocate (void *ptr, size_t bytes);
void deallocate (void *ptr, size_t bytes, size_t alignment);
void* data (void);
void* begin (void);
void* end (void);
void* cursor (void);
const void* data (void) const;
const void* begin (void) const;
const void* end (void) const;
const void* cursor (void) const;