I am learning about malloc
function in C. I know how to request memory with
p = malloc(number_of_bytes);
and to free it later when it's not used with
free(p);
But I want to know something a bit more theoretical than this: I know that with virtual memory, there are three possibilities:
A virtual address can have no physical storage assigned (in pagefile or in physical memory)
A virtual address can have physical storage on the pagefile
A virtual address can have physical storage on physical memory
So, my question is:
Where does malloc
returned memory is (I mean, is it on the pagefile, on the physical memory (heap maybe?))?