[comp.sys.mac.programmer] Re^2: Segmentation

drc@claris.com (Dennis Cohen) (11/02/89)

tim@hoptoad.uucp (Tim Maroney) writes:
>>o  how to make sure there will always be space to load a swapped-out
>>segment.

>This is a bit more perceptive.  Answer is: you have to make sure there
>is always a contiguous chunk of storage which is free and which is as
>large as the combination of the largest unloadable segments which may
>need to be simultaneously loaded.  If this sounds difficult to compute,
>it's because it is; it would be easy to overlook a possible combination
>of segments which could occur at some point in execution.  Nor would
>testing do much good, since all the tester could tell you would be "It
>just quit all of a sudden while I was doing X!"  Doing X is likely to
>take you here, there, and everywhere in the code.

Although they seldom have anything Mac-useful in their monthly publication,
Dr. Dobb's 2nd Annual Mac issue (says on cover to display until January 17,
1990) actually has some very good articles in it.  One of them is by Apple's
Curt Bianchi and discusses the procedural (ie non-oo) memory management
scheme used by MacApp and how it might be useful to non-MacApp programmers.
It covers the issues raised by the original article in this chain and is
quite readable and understandable.