I am playing around with the c functions malloc and calloc and I have some questions.
I want to see if I can use these 2 functions to allocate only physical memory, my mac has 4gb or ram and when I use malloc I can allocate way more than 4gb, which means malloc allocate both physical and virtual memory.
I have a couple of questions:
is there any function I can use, so that I can only allocate the physical memory (w/o allocating the virtual mem)
when calling malloc and calloc and when the pointers return, is there any way I can use the pointers to determine how much physical memory are allocated and how much virtual memory are allocate?
a quick example will be really appreciated :)
thanks for your help :)