[Mesa-dev] [PATCH 1/4] mesa/util: add util_dynarray_clear() helper
Samuel Pitoiset
samuel.pitoiset at gmail.com
Wed Jun 14 11:55:09 UTC 2017
Signed-off-by: Samuel Pitoiset <samuel.pitoiset at gmail.com>
---
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.13.1
More information about the mesa-dev
mailing list