CTX is a basic modified STB-Style library for basic memory management using contexts/arenas.
Linux/MacOS Steps:
cc -Wall -Wextra -Isrc example/main.c -o application
./application
Windows Steps: *
cl /Feapplication.exe /I"src" example/main.c
.\application.exe
Note: All Windows testing was performed using PortableBuildTools and not tested using Visual Studio
// main.c
#define CTX_IMPL
#include "ctx.h"
int main (void) {
// Static Context
Context ctx = new_context (1 KB);
int* life = context_alloc (&ctx, sizeof (int));
*life = 42;
CTX_LOG ("[STATIC]: life = %d\n", *life);
// Temp Context
int* unlucky = context_talloc (sizeof (int));
*unlucky = 13;
CTX_LOG ("[TEMP]: unlucky = %d\n", *unlucky);
context_free (&ctx);
context_tfree ();
return 0;
}