alternative Standard Libary  0.29.8
std::buffer_allocator Klassenreferenz

#include <buffer_allocator.hpp>

Öffentliche Methoden

 buffer_allocator (const char *name, char *mem, size_t bufferSize)
 
void * allocate (size_t bytes, int flags=0)
 
void deallocate (void *ptr, size_t bytes)
 
const char * get_name () const
 

Ausführliche Beschreibung

Beschreibung der Konstruktoren und Destruktoren

◆ buffer_allocator()

std::buffer_allocator::buffer_allocator ( const char *  name,
char *  mem,
size_t  bufferSize 
)
inlineexplicit
43  : m_name(name), m_buffer(mem), m_bufferTop(0), m_bufferSize(bufferSize)
44  {
45  }

Dokumentation der Elementfunktionen

◆ allocate()

void* std::buffer_allocator::allocate ( size_t  bytes,
int  flags = 0 
)
inline
48  {
49  assert(m_bufferTop + bytes <= m_bufferSize);
50  char* ret = m_buffer + m_bufferTop;
51  m_bufferTop += bytes;
52  return ret;
53  }

◆ deallocate()

void std::buffer_allocator::deallocate ( void *  ptr,
size_t  bytes 
)
inline
55  {
56  assert(ptr == 0 || (ptr >= m_buffer && ptr < m_buffer + m_bufferSize));
57  sizeof(ptr);
58  }

◆ get_name()

const char* std::buffer_allocator::get_name ( ) const
inline
60 { return m_name; }

Die Dokumentation für diese Klasse wurde erzeugt aufgrund der Datei: