Added some bits for arena allocator work
This commit is contained in:
parent
7ebdc2ec36
commit
d70d2a9da2
3 changed files with 7 additions and 2 deletions
|
|
@ -6,3 +6,9 @@
|
||||||
- [ ] implement textures and simple lighting
|
- [ ] implement textures and simple lighting
|
||||||
- [ ] Figure out a simple game to make with this engine
|
- [ ] Figure out a simple game to make with this engine
|
||||||
|
|
||||||
|
* TODO Arena Allocator Requirements
|
||||||
|
- [ ] Sub arenas
|
||||||
|
- [ ] contiguos memory spaces for dynamic arrays that grow larger than the arena size
|
||||||
|
** Optional
|
||||||
|
- [ ] free lists to reuse abandoned chunks of memory arenas
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
#define DEFAULT_ARENA_SIZE 1048576 /* 8 * 1024 * 1024 : 8MB*/
|
#define DEFAULT_ARENA_SIZE 1048576 /* 8 * 1024 * 1024 = 8MB */
|
||||||
|
|
||||||
Arena arena_init(size_t capacity) {
|
Arena arena_init(size_t capacity) {
|
||||||
if (capacity == 0) {
|
if (capacity == 0) {
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,6 @@
|
||||||
#include "window.h"
|
#include "window.h"
|
||||||
|
|
||||||
int main(int argc, char *argv[]) {
|
int main(int argc, char *argv[]) {
|
||||||
|
|
||||||
wn_window window = {0};
|
wn_window window = {0};
|
||||||
if (!wn_window_init(&window)) {
|
if (!wn_window_init(&window)) {
|
||||||
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't initialize wn_window");
|
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't initialize wn_window");
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue