util.h (441B)
1 #define allocztn(type, n) allocz(sizeof(type) * n) 2 #define alloczt(type) allocz(sizeof(type)) 3 4 typedef struct mctx { 5 int ptrc; 6 void **ptrs; 7 } mctx; 8 9 extern mctx *gctx; 10 11 void *alloczctx(mctx *ctx, const size_t size); 12 void *realloczctx(mctx *ctx, void *ptr, const size_t size); 13 void *reallocz(void *ptr, const size_t size); 14 void *allocz(const size_t size); 15 mctx *newctx(); 16 void freectx(mctx *ctx); 17 char *strslice(char *s, int len);