Relative Content

Tag Archive for linuxheap-memorymmapvirtual-memoryvirtual-address-space

Where is the heap located in the virtual address space of a program?

I have trouble grasping how memory allocators work. As far as I understand mapping physical memory to the heap of a program would require the allocator to know where the heap’s start and end virtual address are. i.e. in linux mmap takes a pointer argument – address, to which it maps a physical memory region. My question is how do I acquire these memory addresses?