News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

HeapAlloc and VirtualAlloc

Started by The_Grey_Beast, April 29, 2005, 03:00:04 PM

Previous topic - Next topic

The_Grey_Beast

What is the difference between them (except that VirtualAlloc rounds to page boundaries). Why use VirtualAlloc if HeapAlloc can do the job?

Also, please help me with this: Virtual memory = Physical Memory + Swap Page File (right?).. Is HeapAlloc allocating in the Swap File if there is not enough Physical memory, or does it report an Out of Memory error because there is not enough physical memory? Thanks.  :toothy

hutch--

I moved this posting to the workshop so that you will get more answers. The MASM32 forum is for MASM32 specific postings.
Download site for MASM32      New MASM Forum
https://masm32.com          https://masm32.com/board/index.php

Eóin

I'm not an expert, but VirtualAlloc is a lowerlevel memory management function, HeapAlloc would be higher level. Basically use HeapAlloc unless you're reserving very large blocks of memory or need the extra control VirtualAlloc provides.