|
GCSIM
|
represents a single segment on the heap. More...
#include <segment.hpp>
Public Member Functions | |
| segment () | |
| creates an instance of the segment. | |
| ~segment () | |
| deletes the segment. | |
| segment (const segment &)=delete | |
| deleted copy constructor. | |
| segment & | operator= (const segment &)=delete |
| deleted assignment operator. | |
| segment (segment &&other) noexcept | |
| constructs new segment from an existing one. | |
| segment & | operator= (segment &&other) noexcept |
| constructs new segment by assigning it an existing one. | |
| void | initialize () |
| initializes the free memory and sets initial header. | |
Public Attributes | |
| uint8_t * | segment_memory |
| pointer to the segment's memory block. | |
| uint32_t | free_memory |
| number of bytes that are free in segment. | |
represents a single segment on the heap.
| segment::segment | ( | ) |
creates an instance of the segment.
allocates SEGMENT_SIZE bytes of memory.
| std::bad_alloc | when memory allocation fails. |
| segment::~segment | ( | ) |
deletes the segment.
frees the allocated memory.
|
delete |
deleted copy constructor.
|
noexcept |
constructs new segment from an existing one.
| other | - rvalue of the existing segment. |
moves ownership of the data from other to this.
| void segment::initialize | ( | ) |
initializes the free memory and sets initial header.
constructs new segment by assigning it an existing one.
| other | - rvalue of the existing segment. |
moves ownership of the data from other to this.
| uint32_t segment::free_memory |
number of bytes that are free in segment.
| uint8_t* segment::segment_memory |
pointer to the segment's memory block.