home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.sys.mac.programmer
- Path: sparky!uunet!zaphod.mps.ohio-state.edu!uwm.edu!spool.mu.edu!umn.edu!csus.edu!netcom.com!upstill
- From: upstill@netcom.com (Steve Upstill)
- Subject: Resource Manager Purging Wierdness
- Message-ID: <1992Dec30.070004.6847@netcom.com>
- Organization: Netcom - Online Communication Services (408 241-9760 guest)
- Distribution: usa
- Date: Wed, 30 Dec 1992 07:00:04 GMT
- Lines: 31
-
- I know this is the brave new world of unlimited RAM, but here I am
- struggling to live in the world of Mac Plus'es and SE's, so I make
- everything in the world purgeable, including a variety of resources.
- I dutifully call SetResPurge(TRUE) so that any changed resources
- (yes, I change them too) get written to disk. But still, under
- low-memory conditions my resources start disappearing on me
- (i.e., they're read in at size 0), implying that they were written
- to disk empty anyway.
-
- Now, there are ominous hints here and there that if the resource map is
- written to disk and a resource has been purged, then an empty resource
- will be written because, regardless of whether the resource was written
- out at purge-time, it's still empty in memory and so the map is incorrect.
- Unfortunately, this is as deep as the discussion gets (??!?), leaving
- only a tantalizing hint to the effect that "yes, we may destroy your data,
- but we're not going to say for sure, or indicate exactly when it might happen."
-
- So it looks like data gets trashed under the following scenario:
-
- 1) a purgeable resource gets purged.
- 2) another resource is marked as changed
- 3) UpdateResFile() is called (perhaps by CloseResFile()). Because the map
- has changed, the file gets written. Because the resource from 1) was
- purged, its handle is empty and thus gets written empty.
-
- I can't believe that this can happen this way, yet I am at a loss to
- otherwise explain the 0-length resources that keep cropping up. Any clues?
-
- Thanks,
- Steve Upstill
-
-