Win32 memory allocation with large alignment

后端 未结 2 776
遥遥无期
遥遥无期 2021-01-13 19:23

I need to allocate large regions of memory (megabytes) with large alignments (also potentially in the megabyte range). The VirtualAlloc family of functions don\'t seem to p

2条回答
  •  一整个雨季
    2021-01-13 19:26

    Yes, you can use the same technique. VirtualAlloc a large range as MEM_RESERVE. Find the sub-range that is appropriately aligned and call VirtualAlloc a second time on the sub-range with MEM_COMMIT.

提交回复
热议问题