mesa/util: add util_dynarray_clear() helper
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>
Wed, 14 Jun 2017 11:55:09 +0000 (13:55 +0200)
committerSamuel Pitoiset <samuel.pitoiset@gmail.com>
Sun, 18 Jun 2017 12:10:32 +0000 (14:10 +0200)
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
src/util/u_dynarray.h

index 57f96ff79c0ea7b9b7e1e8e279c2ceee568d822a..cc316323f2884e96d68c89618f07e620ac082082 100644 (file)
@@ -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 */