WIP borrow allocator

This commit is contained in:
2025-10-06 22:26:08 +02:00
parent d394e4fa34
commit 4463c6a7c5
2 changed files with 37 additions and 1 deletions
+17
View File
@@ -0,0 +1,17 @@
#include "allocator.h"
void *borrow_allcoator_alloc(borrow_allocator_t *this, size_t bytes) {
linked_allocation_node_t *node = malloc(sizeof(*this->head) + bytes);
node->prev = NULL;
node->next = this->head;
if (this->head != NULL) {
// TODO: correct?
this->head.prev = node;
}
this->head = node;
}
void *borrow_allcoator_resize(borrow_allocator_t *this, void *old_ptr, size_t bytes) {
}
void borrow_allcoator_free(borrow_allocator_t *this, void *old_ptr) {
}