DSC Engine
Loading...
Searching...
No Matches
allocator.hpp
Go to the documentation of this file.
1
5#pragma once
6
7namespace DSC
8{
11 {
12 private:
13 unsigned char id;
14 int base_offset;
15 int base_length;
16 int free_space_head;
17 public:
18 Allocator();
19
26 Allocator(int offset, int length);
27
33 void* reserve(int size, int desired_offset = -1);
34
40 void release(void* address);
41
42 ~Allocator();
43
44 static Allocator defaultMainSpriteVram();
45 static Allocator defaultSubSpriteVram();
46 };
47}
flexible VRAM manager
Definition: allocator.hpp:11
void * reserve(int size, int desired_offset=-1)
The equivalent of malloc(size).
Allocator(int offset, int length)
Creates a new allocator instance.
void release(void *address)
frees the specified offset