From: Samuel Pitoiset Date: Wed, 14 Jun 2017 11:55:09 +0000 (+0200) Subject: mesa/util: add util_dynarray_clear() helper X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=db735950187e14863bac52e88ef805b9b1c65563;p=mesa.git mesa/util: add util_dynarray_clear() helper Signed-off-by: Samuel Pitoiset Reviewed-by: Marek Olšák --- diff --git a/src/util/u_dynarray.h b/src/util/u_dynarray.h index 57f96ff79c0..cc316323f28 100644 --- a/src/util/u_dynarray.h +++ b/src/util/u_dynarray.h @@ -68,6 +68,12 @@ util_dynarray_fini(struct util_dynarray *buf) } } +static inline void +util_dynarray_clear(struct util_dynarray *buf) +{ + buf->size = 0; +} + #define DYN_ARRAY_INITIAL_SIZE 64 /* use util_dynarray_trim to reduce the allocated storage */