Object Orientation
The rise of object-oriented languages for programming the Mac – first Object Pascal, then later C++ – also caused problems for the memory model adopted. At first, it would seem natural that objects would be implemented via handles, to gain the advantage of being relocatable. However, these languages, as they were originally designed, used pointers for objects, which would lead to fragmentation issues. A solution, implemented by the THINK (later Symantec) compilers, was to use Handles internally for objects, but use a pointer syntax to access them. This seemed a good idea at first, but soon deep problems emerged, since programmers could not tell whether they were dealing with a relocatable or fixed block, and so had no way to know whether to take on the task of locking objects or not. Needless to say this led to huge numbers of bugs and problems with these early object implementations. Later compilers did not attempt to do this, but used real pointers, often implementing their own memory allocation schemes to work around the Mac OS memory model.
While the Mac OS memory model, with all its inherent problems, remained this way right through to Mac OS 9, due to severe application compatibility constraints, the increasing availability of cheap RAM meant that by and large most users could upgrade their way out of a corner. The memory wasn't used efficiently, but it was abundant enough that the issue never became critical. This is perhaps ironic given that the purpose of the original design was to maximise the use of very limited amounts of memory. OS X finally did away with the whole scheme, implementing a modern sparse virtual memory scheme. A subset of the older memory model APIs still exist for compatibility as part of Carbon, but map to the modern memory manager (a threadsafe malloc implementation) underneath. Apple recommends that OS X code use malloc and free "almost exclusively".
Read more about this topic: Mac OS Memory Management
Famous quotes containing the words object and/or orientation:
“In youth the human body drew me and was the object of my secret and natural dreams. But body after body has taken away from me that sensual phosphorescence which my youth delighted in. Within me is no disturbing interplay now, but only the steady currents of adaptation and of sympathy.”
—Haniel Long (18881956)
“Institutions of higher education in the United States are products of Western society in which masculine values like an orientation toward achievement and objectivity are valued over cooperation, connectedness and subjectivity.”
—Yolanda Moses (b. 1946)