Skip to content

Instantly share code, notes, and snippets.

View Warkanlock's full-sized avatar
🎯
Focusing

txxnano Warkanlock

🎯
Focusing
View GitHub Profile
#include <stdio.h>
#include <stdlib.h>
#define da_append(xs, x) \
do { \
if ((xs)->count >= (xs)->capacity) { \
if ((xs)->capacity == 0) (xs)->capacity = 256; \
else (xs)->capacity *= 2; \
(xs)->items = realloc((xs)->items, (xs)->capacity*sizeof(*(xs)->items)); \
} \