Skip to main content
Home Documents Game Manuals Sw Hints
Sw Hints

Sw Hints

Game Manuals · PDF
FilenameSwHints.pdf
Size0.08 MB
Subsection Sw Hints
Downloads0
Enjoying MacTrove? Anonymous downloads are free and unlimited. Create a free account to track favorites, contribute metadata corrections, and join the community chat.
Reader
Sw Hints
/
Loading…
OCR / Text contents
A Software Developer's Guide to Switcher Andy Hertzfeld 9 Apr 85 The Macintosh Application Switcher creates a dynamic new software environment for the 512K (or larger) Macintosh, allowing multiple application programs to reside simultaneously in memory and providing a way to switch between them very quickly. The Switcher tries to support every Macintosh application, but the interface between a program and its environment is very complex, and Switcher necessarily disturbs this delicate balance, so some programs are not compatible with it. This document is intended for an audience of Macintosh software developers and will provide suggestions and hints that will help your application to get the most out of the Switcher environment. The most recent version of the Switcher is version 2.0, the beta release. Included with the release are new versions of the Macsbug debugger that are compatible with the Switcher. Earlier versions of Macsbug had a bug that made them not work with Switcher, so be sure to use these new versions when testing your applications out with Switcher. When you find that your application doesn't work properly with Switcher, please try to pinpoint the difficulty as precisely as possible when reporting the bug; bugs can be reported to Apple, on MAUG/Compuserve (my number is 70167,3430) or directly to me at (415) 322-8696. One source of developer confusion is caused by the way the Switcher fudges memory size statistics. It turns out you have to allocate a 96K partition for an application to have approximately the same amount of memory it has on a 128K Mac. To avoid confusion for the typical user, the Switcher adds 32K to the size of a partition before displaying it. Thus partition sizes are "normalized" to the well-known 128K Mac; for example, a partition that's displayed as 256K actually only has 224K allocated to it. The Switcher knows how much memory to allocate to a given program by inspecting the "SIZE -1" resource attached to the program file. The Switcher is capable of generating its own SIZE blocks using the Configure command, but it would be very nice if new applications could come "pre-configured" for their own unique memory requirements and other properties. The size block is 10 bytes long; there is a flags word followed by 2 long integers. The first long integer is the recommended size of the partition, followed by the minimum size. The values are 32K less than the virtual partition size (i.e. 96K for a 128K partition). Currently, only the high two bits of the flags word are defined. Bit 15 means "save screen" and bit 14 means "suspend/resume" events. (see below). Unassigned bits should be kept 0 for future compatibility. While working at Apple, I had the opportunity to watch a number of fairly complicated Macintosh applications go through their final debugging cycles. The most time-consuming and difficult part of this process is what you might call "memory tuning", which is dealing with various out-of-memory situatio…

Showing first 3,000 characters of 10,266 total. Open the full document →

mp.ls