From db735950187e14863bac52e88ef805b9b1c65563 Mon Sep 17 00:00:00 2001 From: Samuel Pitoiset Date: Wed, 14 Jun 2017 13:55:09 +0200 Subject: [PATCH] mesa/util: add util_dynarray_clear() helper MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Samuel Pitoiset Reviewed-by: Marek Olšák --- src/util/u_dynarray.h | 6 ++++++ 1 file changed, 6 insertions(+) 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 */ -- 2.30.2