Program Memory Model

Mac OS X processes have a conceptual memory model, where memory is divided into space for the executable code, a stack, a heap, and other bits and pieces, as shown in Figure 7.2:

Figure 7.2  Unix program memory model

Unix program memory model

Text Segment

The executable program code lives here. At program launch time, the code is mapped into memory from the executable on disk as read-only pages. Since these pages are read-only, they can be easily shared among multiple processes, so the pages only have to appear in physical memory once and can still be shared among multiple users. They can, of course, appear multiple times in the virtual memory of other ...

Get Advanced Mac OS X Programming: The Big Nerd Ranch Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.