diff options
author | Samuel Pitoiset <samuel.pitoiset@gmail.com> | 2017-06-14 13:55:09 +0200 |
---|---|---|
committer | Samuel Pitoiset <samuel.pitoiset@gmail.com> | 2017-06-18 14:10:32 +0200 |
commit | db735950187e14863bac52e88ef805b9b1c65563 (patch) | |
tree | 422ad605d7720b02325cf5e2130acf90272b3f6d /src/util | |
parent | 8d9e76ce1f7d78a6408e08109052c426dabc5480 (diff) |
mesa/util: add util_dynarray_clear() helper
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Diffstat (limited to 'src/util')
-rw-r--r-- | src/util/u_dynarray.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/util/u_dynarray.h b/src/util/u_dynarray.h index 57f96ff79c..cc316323f2 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 */ |