From ba4b7e9c44b62c2bf8c8346aa8c5d9659724638e Mon Sep 17 00:00:00 2001 From: Jason Ekstrand Date: Wed, 11 Oct 2017 12:13:19 -0700 Subject: [PATCH] anv/multialloc: Add new add_size helper Reviewed-by: Jordan Justen --- src/intel/vulkan/anv_private.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/intel/vulkan/anv_private.h b/src/intel/vulkan/anv_private.h index 00264af8f29..e8a845f7229 100644 --- a/src/intel/vulkan/anv_private.h +++ b/src/intel/vulkan/anv_private.h @@ -438,9 +438,11 @@ _anv_multialloc_add(struct anv_multialloc *ma, ma->ptrs[ma->ptr_count++] = ptr; } +#define anv_multialloc_add_size(_ma, _ptr, _size) \ + _anv_multialloc_add((_ma), (void **)(_ptr), (_size), __alignof__(**(_ptr))) + #define anv_multialloc_add(_ma, _ptr, _count) \ - _anv_multialloc_add((_ma), (void **)(_ptr), \ - (_count) * sizeof(**(_ptr)), __alignof__(**(_ptr))) + anv_multialloc_add_size(_ma, _ptr, (_count) * sizeof(**(_ptr))); __attribute__((always_inline)) static inline void * -- 2.30.2