vec: vec_try_append

Essentially a method to attempt to append data but without doing any
reallocation - stay within the bounds of the capacity.
This commit is contained in:
2026-02-13 00:07:24 +00:00
committed by oreodave
parent e6e501c5a3
commit 0e75b541df
2 changed files with 18 additions and 1 deletions

View File

@@ -36,7 +36,10 @@ void vec_init(vec_t *, u64);
void vec_free(vec_t *);
u8 *vec_data(vec_t *);
// Append, possibly reallocating memory
void vec_append(vec_t *, const void *const, u64);
// Try to append without allocating memory
bool vec_try_append(vec_t *, const void *const, u64);
void vec_ensure_free(vec_t *, u64);
void vec_clone(vec_t *, vec_t *);