Initial commit, yay

This commit is contained in:
VegOwOtenks 2024-06-13 15:28:21 +02:00
commit 25e26756cd
85 changed files with 7077 additions and 0 deletions

View file

@ -0,0 +1,29 @@
#ifndef SCRATCHPAD_H
#define SCRATCHPAD_H
#include "../allocator-interface/allocator-interface.h"
#include <stddef.h>
typedef struct Scratchpad_s {
void* memory;
size_t capacity;
size_t reserved;
struct Scratchpad_s* next;
allocator_t* allocator;
} Scratchpad;
/*!
@brief Create a new Scratchpad Buffer
@param target this
@param capacity How many bytes the buffer should hold initially
@return EXIT_SUCCESS, ENOMEM, EDESTADDRREQ
*/
int Scratchpad_Create(Scratchpad* target, size_t capacity, allocator_t* allocator);
void* Scratchpad_Reserve(Scratchpad* pad, size_t size);
int Scratchpad_Reclaim(Scratchpad* pad, void* pointer, size_t length);
void Scratchpad_Reset(Scratchpad* pad);
void Scratchpad_Destroy(Scratchpad* pad);
#endif