Allocating aligned memory in Windows


A question came up on an internal alias about allocating memory blocks along page alignments, and it was harder than I expected to find the answer.  So here is the link to _aligned_malloc
 on MSDN
, and now Google can work its magic.


http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vclib/html/vclrf_aligned_malloc.asp


_aligned_malloc
Allocates memory on a specified alignment boundary.

Comments (2)

  1. zia says:

    If _aligned_malloc didn’t exist, do you think it would be difficult to write a function that does the same yourself? I hope you can’t pass a Microsoft job interview if you do. 🙂

  2. Abhay Jain says:

    Thanks a lot, This is really a great help and has saved my lot of time.