aboutsummaryrefslogtreecommitdiffstats
path: root/src/util/u_dynarray.h
diff options
context:
space:
mode:
authorSamuel Pitoiset <[email protected]>2017-06-14 13:55:09 +0200
committerSamuel Pitoiset <[email protected]>2017-06-18 14:10:32 +0200
commitdb735950187e14863bac52e88ef805b9b1c65563 (patch)
tree422ad605d7720b02325cf5e2130acf90272b3f6d /src/util/u_dynarray.h
parent8d9e76ce1f7d78a6408e08109052c426dabc5480 (diff)
mesa/util: add util_dynarray_clear() helper
Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
Diffstat (limited to 'src/util/u_dynarray.h')
-rw-r--r--src/util/u_dynarray.h6
1 files changed, 6 insertions, 0 deletions
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 */