Does malloc allocate a block of memory on the heap or should it be called Virtual Address Space?
Am I being picky calling it Virtual Address Space or this just the legac
Malloc always returns virtual address, the reason is that when you call malloc it's actually a wrapper function which calls a system call (system call is a fancy word for kernel level instructions) and this system call allocates a virtual memory inside of your heap segment. But when you want to access the allocated value (store or load instruction) MMU will raise Page fault which basically means there is no physical memory for this virtual page, and only at that time OS will allocate physical memory for this virtual page .