@lanodan @polygon tbh this will be fixed in C29, it allows us to have proper generics (using macros and structural typing) and hence just:
#define vec(T) struct _Record { size_t len; T *data; }
or, in places where growth is necessary, using an additional capacity field and then doing the usual doubling of capacity to grow it for amortized O(1) insertion