[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Resource Manager - please help!
In article <1tb9sf$jrj@altitude.HIP.CAM.ORG> vandry@CAM.ORG (Phillip Vandry) writes:
>
> Another memory question..
>
> Why does _CompactMem do nothing in CDAs. How could it do any harm?
It depends where you were when you called up the CDA menu.
If the Event Manager is active, then pressing Control-Apple-Esc will
queue a DeskEvent, which is picked up in the next GetNextEvent call.
A CDA will be able to compact memory in this situation.
If the Event Manager is not active, then pressing Control-Apple-Esc
causes the CDA menu to be displayed while the original interrupt is
still active. The interrupted program might be in the middle of
accessing data in an unlocked handle, so allowing memory compaction
is dangerous - the data would suddenly move out from under the
application.
The same applies to any interrupt handler - the CompactMem call does
nothing if an interrupt is being processed.
Unlocked handles are only allowed to move while the system is in an
application-generated toolbox or operating system call.
--
David Empson
dempson@swell.actrix.gen.nz <--- Note my new E-Mail address!
Snail mail: P.O. Box 27-103, Wellington, New Zealand