SetResPurge
SetResPurge Force resource changes to be written before purge This procedure is used by applications intending to change purgeable
doCheck is a Boolean value indicating whether to install or de- install
resource purge checking. It is one of:
FALSE Normal operation; no purge checking TRUE Before purging any handle data, check if it is a changed resource and, if it is, write its data to disk.
Notes: SetResPurge is an attempt to avoid the "silent error" of writing a 0-length resource to disk when a resource file is updated. It is needed only
by applications that modify a resource tagged as resPurgeable (see
In a memory shortage situation the Memory Manager will discard all
purgeable resources and compact memory. Then, when you
this problem. Another way is to set the address of a custom "purge warning
handler" into the purgeProc field of the memory manager's Zone structure obtained via ApplicZone. Yet another way is: avoid changing purgeable resources altogether!
Note that this does NOT keep the resource from getting purged. You must
use LoadResource before each access of an unlocked purgeable resource. See HNoPurge for a way to force any purgeable handle to remain in memory.