![]() |
Max OS 0.3
|
A span of memory in the heap, can be allocated or free. Used as a node in a doubly linked list. More...
#include <bump.h>
Public Member Functions | |
| bool | is_valid () |
| ChunkHeader * | prev_chunk () |
| ChunkHeader * | next_chunk () |
Public Attributes | |
| uint16_t | canary |
| Trip value to detect buffer overflows. | |
| ChunkHeader * | next |
| Pointer to the chunk after this one in the list. | |
| ChunkHeader * | prev |
| Pointer to the chunk before this one in the list. | |
| uint8_t | allocated |
| Whether this chunk is in use or can be allocated. | |
| size_t | size |
| The size of this span of memory (not including the MemoryChunk struct itself) | |
A span of memory in the heap, can be allocated or free. Used as a node in a doubly linked list.
| bool ChunkHeader::is_valid | ( | ) |
Validate that a given chunk is as expected
Definition at line 39 of file bump.cpp.
References canary.
Referenced by next_chunk(), and prev_chunk().
| chunk_header_t * ChunkHeader::next_chunk | ( | ) |
Safely gets the next chunk. Will crash the program (not the kernel) if invalid chunk
Definition at line 67 of file bump.cpp.
References is_valid(), and next.
Referenced by MaxOS::memory::allocator::BumpAllocator::allocate(), and MaxOS::memory::allocator::BumpAllocator::amount_used().
| chunk_header_t * ChunkHeader::prev_chunk | ( | ) |
Safely gets the prev chunk. Will crash the program (not the kernel) if invalid chunk
Definition at line 50 of file bump.cpp.
References is_valid(), and prev.
Referenced by MaxOS::memory::allocator::BumpAllocator::unallocate().
| uint8_t MaxOS::memory::allocator::ChunkHeader::allocated |
Whether this chunk is in use or can be allocated.
Definition at line 32 of file bump.h.
Referenced by MaxOS::memory::allocator::BumpAllocator::allocate(), and MaxOS::memory::allocator::BumpAllocator::setup_region().
| uint16_t MaxOS::memory::allocator::ChunkHeader::canary |
Trip value to detect buffer overflows.
Definition at line 27 of file bump.h.
Referenced by MaxOS::memory::allocator::BumpAllocator::allocate(), is_valid(), and MaxOS::memory::allocator::BumpAllocator::setup_region().
| ChunkHeader* MaxOS::memory::allocator::ChunkHeader::next |
Pointer to the chunk after this one in the list.
Definition at line 29 of file bump.h.
Referenced by MaxOS::memory::allocator::BumpAllocator::allocate(), next_chunk(), and MaxOS::memory::allocator::BumpAllocator::setup_region().
| ChunkHeader* MaxOS::memory::allocator::ChunkHeader::prev |
Pointer to the chunk before this one in the list.
Definition at line 30 of file bump.h.
Referenced by MaxOS::memory::allocator::BumpAllocator::allocate(), prev_chunk(), and MaxOS::memory::allocator::BumpAllocator::setup_region().
| size_t MaxOS::memory::allocator::ChunkHeader::size |
The size of this span of memory (not including the MemoryChunk struct itself)
Definition at line 33 of file bump.h.
Referenced by MaxOS::memory::allocator::BumpAllocator::allocate(), MaxOS::memory::allocator::BumpAllocator::setup_region(), and MaxOS::memory::allocator::BumpAllocator::unallocate().