diff options
author | Kimplul <kimi.h.kuparinen@gmail.com> | 2025-03-14 21:08:01 +0200 |
---|---|---|
committer | Kimplul <kimi.h.kuparinen@gmail.com> | 2025-03-14 21:08:01 +0200 |
commit | f5c729ea59d227a507f83bd94d07f4366b46d72b (patch) | |
tree | 70d1f242100cea09acd38a71ff8c821836117cfd /src/vec.h | |
parent | 57f6b41047e95374701ee276248f0f8615168450 (diff) | |
download | ejit-f5c729ea59d227a507f83bd94d07f4366b46d72b.tar.gz ejit-f5c729ea59d227a507f83bd94d07f4366b46d72b.zip |
start supporting 32bit arches
Diffstat (limited to 'src/vec.h')
-rw-r--r-- | src/vec.h | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -73,6 +73,7 @@ static inline void VEC(append)(struct VEC_STRUCT *v, VEC_TYPE n) if (v->n >= v->s) { v->s *= 2; v->buf = realloc(v->buf, v->s * sizeof(VEC_TYPE)); + assert(v->buf); } v->buf[v->n - 1] = n; @@ -99,6 +100,9 @@ static inline void VEC(reserve)(struct VEC_STRUCT *v, size_t n) return; v->n = n; + if (v->s >= v->n) + return; + while (v->s < v->n) v->s *= 2; |