Highlighting aligned data (memalign) in Visual C ++

I have a small prototype program written in C ++ that runs on Linux using the memalign function to highlight border-aligned regions such as pages. Is there an equivalent function in Visual C ++?

+5
source share
1 answer

You are looking for _ aligned_malloc . Note that memory must be freed using _aligned_free , and this alignment is limited to powers of 2.

If you need more flexibility, itโ€™s not difficult for you to implement your own solution, for which malloc alignment + bytes pieces of memory start with.

+5
source

All Articles