Add padding to stack array

This commit is contained in:
2026-01-03 03:14:53 +00:00
parent 576699996f
commit abad2fa02a

View File

@@ -84,7 +84,10 @@ typedef Str8 *Str8Array;
return *((TYPE *)_array_pop((GenericArray)ARRAY, sizeof(TYPE))); \
}())
#else
#define _stack_array(TYPE, SIZE) struct { ArrayHeader header; TYPE items[SIZE]; }
#define _stack_array(TYPE, SIZE) struct {ArrayHeader header; \
TYPE items[SIZE]; \
wapp_misc_utils_padding_size(sizeof(ArrayHeader) + \
sizeof(TYPE) * SIZE);}
#define wapp_array(TYPE, ...) \
(TYPE *)( \
(_stack_array(TYPE, _calc_array_capacity(TYPE, __VA_ARGS__))){ \