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.

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.

Skip to main content