mmap is more general than memory mapping files. It "establish[es] a mapping between an address space of a process and a memory object". In particular, many allocators (malloc and friends) use mmap to get a block of memory from the OS with mmap(0, size, PROT_READ|PROT_WRITE, MAP_ANONYMOUS, -1, 0); or similar.