If the array is dynamically allocated on its own, you will likely get a whole page from any decent allocator. If it is statically allocated the compiler can at least theoretically optimize the alignment. If its allocated as part of a larger struct then yes its up to you.
Even if it is not aligned, an unaligned 8K array would be spread to three pages which is still worse than two.
If the array is dynamically allocated on its own, you will likely get a whole page from any decent allocator. If it is statically allocated the compiler can at least theoretically optimize the alignment. If its allocated as part of a larger struct then yes its up to you.
Even if it is not aligned, an unaligned 8K array would be spread to three pages which is still worse than two.