[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Minios-devel] [UNIKRAFT PATCH v2 5/6] include/essentials: Add ARRAY_SIZE macro



Reviewed-by: Yuri Volchkov <yuri.volchkov@xxxxxxxxx>

Costin Lupu <costin.lupu@xxxxxxxxx> writes:

> New definition for retrieving the size for arrays.
>
> Signed-off-by: Costin Lupu <costin.lupu@xxxxxxxxx>
> ---
>  include/uk/essentials.h | 4 ++++
>  1 file changed, 4 insertions(+)
>
> diff --git a/include/uk/essentials.h b/include/uk/essentials.h
> index 1cabb20..f9a7fd1 100644
> --- a/include/uk/essentials.h
> +++ b/include/uk/essentials.h
> @@ -168,6 +168,10 @@ extern "C" {
>  #define ALIGN_DOWN(v, a) ((v) & ~((a)-1))
>  #endif
>  
> +#ifndef ARRAY_SIZE
> +#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
> +#endif
> +
>  #ifndef DECONST
>  #include <uk/arch/types.h>
>  #define DECONST(t, a) ((t)((__uptr)((const void *)(a))))
> -- 
> 2.11.0
>

-- 
Yuri Volchkov
Software Specialist

NEC Europe Ltd
Kurfürsten-Anlage 36
D-69115 Heidelberg

_______________________________________________
Minios-devel mailing list
Minios-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/minios-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.