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. Needless to say this led to huge numbers of bugs and problems with these early object implementations. 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. A solution, implemented by the THINK (later Symantec) compilers, was to use Handles internally for objects, but use a pointer syntax to access them. These languages, as they were originally designed, used pointers for objects, which would lead to fragmentation issues. At first, it would seem natural that objects would be implemented via handles, to gain the advantage of being relocatable. The rise of object-oriented languages for programming the Mac – first Object Pascal, then later C++ – also caused problems for the memory model adopted. The Macintosh IIci and later Motorola based Macintosh computers had 32-bit clean ROMs. Apple licensed the software from Connectix later in 1991 and distributed it for free. Surprisingly, the first solution to this flaw was published by software utility company Connectix, whose 1991 product MODE32 reinitialized the Memory Manager and repeated early parts of the Mac boot process, allowing the system to boot into 32-bit mode and enabling the use of all the RAM in the machine. Older ROMs did not have any 32-bit Memory Manager support and so was not possible to boot into 32-bit mode. The problem was that the decision to use 24-bit or 32-bit addressing has to be made very early in the boot process, when the ROM routines initialized the Memory Manager to set up a basic Mac environment where NuBus ROMs and disk drivers are loaded and executed. With System 7, the Mac system software was finally made 32-bit clean, but there were still the problem of dirty ROMs. In order to stop continual system crashes caused by this issue, System 6 and earlier running on a 68020 or a 68030 would force the machine into 24-bit mode, and would only recognize and address the first 8 megabytes of RAM, an obvious flaw in machines whose hardware was wired to accept up to 128 MB RAM – and whose product literature advertised this capability. Another application might be memory starved, but would be unable to utilize the free memory 'owned' by another application. Apart from exposing users to esoteric technicalities, it was inefficient, since an application would be made to grab all of its allotted RAM, even if it left most of it subsequently unused. While popular among 'power users', this exposure of a technical implementation detail was against the grain of the Mac user philosophy. Sometimes this value wasn't enough for particular kinds of work, so the value setting had to be exposed to the user to allow them to tweak the heap size to suit their own requirements. The amount of actual RAM allocated to each heap was set by a value coded into the metadata of each application, set by the programmer. Because Apple was now committed to its memory management model, as well as compatibility with existing applications, it was forced to adopt a scheme where each application was allocated its own heap from the available RAM. This was a necessary step forward for users, who found the one-app-at-a-time approach very limiting. The situation worsened with the advent of Switcher, which was a way for a Mac with 512KB or more of memory to run multiple applications at once. Since the entire application heap was dissolved when the application quit, fragmentation was minimized. As long as only one application at a time was run, the system worked well. The machine itself implemented two areas in memory available for this scheme - the system heap (used for the OS), and the application heap. If a memory request required compaction of memory, this was done and the table, called the master pointer block, was updated. Apple's scheme was simple - a handle was simply a pointer into a (non relocatable) table of further pointers, which in turn pointed to the data. To solve this, Apple engineers used the concept of a relocatable handle, a reference to memory which allowed the actual data referred to be moved without invalidating the handle. The primary concern of the original engineers appears to have been fragmentation - that is, the repeated allocation and deallocation of memory through pointers leading to many small isolated areas of memory which cannot be used because they are too small, even though the total free memory may be sufficient to satisfy a particular request for memory.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |