28#ifndef TEMPTABLE_CHUNK_H
29#define TEMPTABLE_CHUNK_H
95 uint8_t *
block()
const;
106 uint8_t *
data()
const;
137 : m_offset(
reinterpret_cast<uint8_t *
>(data) -
149 *chunk_offset_ptr(m_offset) = new_offset;
Chunk is an abstraction with the purpose of representing a smallest logical memory-unit within the Bl...
Definition: chunk.h:68
static Chunk::metadata_type * chunk_offset_ptr(uint8_t *chunk)
Deduce a pointer to the offset of given Chunk.
Definition: chunk.h:164
size_t offset() const
Get the Chunk offset relative to the start of belonging Block.
Definition: chunk.h:154
static constexpr size_t METADATA_SIZE
Chunk metadata size.
Definition: chunk.h:74
Chunk(uint8_t *offset, size_t new_offset) noexcept
Constructor which Block will use to create a fresh Chunk object at the given memory-offset.
Definition: chunk.h:144
static uint8_t * chunk_data_ptr(uint8_t *chunk)
Deduce a pointer to the data payload of given Chunk.
Definition: chunk.h:168
uintptr_t metadata_type
Type that we will be using for storing metadata information.
Definition: chunk.h:71
uint8_t * data() const
Get the pointer to the data section which will be provided to the end-user.
Definition: chunk.h:158
static size_t size_hint(size_t n_bytes)
For given size, how much memory will be occupied by the Chunk.
Definition: chunk.h:160
uint8_t * m_offset
A pointer to the actual memory-location where Chunk is located at.
Definition: chunk.h:133
uint8_t * block() const
Deduce the memory-address of belonging Block.
Definition: chunk.h:152
Definition: allocator.h:48