Linearity and linear memory

Process memory is addressed linearly to simplify how the OS and applications interact with memory. 

In a linear (or flat) memory model, each memory location is assigned a unique address within a single continuous range (within the virtual address space of a process), which makes it much easier for me (and compilers) to perform pointer arithmetic and manage memory without having to deal with segmentation schemes. 

The linear model aligns well with OS that use virtual memory, as it allows the OS to efficiently map virtual addresses to physical memory using mechanisms like page tables—a data structure used by the OS to keep track of the mapping between a process’s virtual memory addresses and the corresponding physical memory locations.

Virtual Memory Page table x86 Page table diagram.

Additionally, linear addressing supports memory protection by enabling the OS to assign permissions (such as read, write, or execute) to memory regions like the stack, heap, and code segment. 

Many CPUs, particularly those based on 64-bit architectures, are also optimized for flat memory models, making this approach efficient and scalable. Overall, linear memory addressing streamlines programming, enhances security, and aligns with the architecture of contemporary computing systems. On macOS the Mach kernel still presents each process with a flat, linear address space, but memory regions are managed through per-task vm_map structures and Mach-O segment/load command permissions, enforced by vm_protect/mmap flags. This is hardened by ASLR, code-signing enforcement and (on Apple Silicon) pointer authentication, giving precise, page-level hooks into stack, heap and code protections.

Memory Models)

Source