For C, see How to allocate aligned memory only using the standard library?. You'd use the result from HeapAlloc() in place of malloc(), presumably. I don't think there's a simple alternative for C++ — the languages C and C++ are different, and never more so than in the area of memory management.
Like I said, man, there's also the _aligned_malloc function I know of, but these functions allocate memory on the process' default heap, while I wish to allocate memory on a private heap since whenever I allocate large amounts of data on the process heap then free it, it does not get released back to the OS the majority of the time, while if I destroy my private heap it is.
Read the answer — it covers how to deal with allocations as if from HeapAlloc(). It only got edited to mention aligned_alloc(), which is the C11 standard function for aligned allocation, a number of years after it was first written.
HeapAlloc()in place ofmalloc(), presumably. I don't think there's a simple alternative for C++ — the languages C and C++ are different, and never more so than in the area of memory management._aligned_mallocfunction I know of, but these functions allocate memory on the process' default heap, while I wish to allocate memory on a private heap since whenever I allocate large amounts of data on the process heap then free it, it does not get released back to the OS the majority of the time, while if I destroy my private heap it is.HeapAlloc(). It only got edited to mentionaligned_alloc(), which is the C11 standard function for aligned allocation, a number of years after it was first written.