home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.sys.mac.programmer
- Path: sparky!uunet!think.com!sdd.hp.com!ux1.cso.uiuc.edu!news.cso.uiuc.edu!alexia!cole
- From: cole@alexia.lis.uiuc.edu (Sandra Stewart-Cole)
- Subject: Getting a resource map in the right heap
- Message-ID: <C0AnxK.JCq@news.cso.uiuc.edu>
- Summary: Question: how to get a resource map to hang around
- Sender: usenet@news.cso.uiuc.edu (Net Noise owner)
- Organization: University of Illinois at Urbana
- Date: Sun, 3 Jan 1993 20:08:07 GMT
- Keywords: resources trap patch arcana
- Lines: 28
-
-
- I'm writing my first serious INIT that involves a couple trap patches and a
- serious quantity of code, and amidst all this I really need to use a resource
- file. I've figured out how to find the file after boot time, but I can't seem
- to open it and maintain access to the resources. The cause from what I can see
- is that even with all my patches and INIT code in the system heap, when I open
- a resource file its map goes into the application heap zone where it is both
- subject to context switching and to trashing when the current app dies. As a
- result, my only solution right now is to expect every time I try accessing the
- file that it might have been made inaccessible and reopening it (as opposed to
- closing it myself and making it subject to some silly user who decides to trash
- or move it) This also may have pitfalls, as the file is not always closed when
- it is inaccessible (i.e. I still have a valid fcb and refnum) and i am not
- thrilled with the idea of getting a seperate resource map and refnum for each
- open app.
-
- What is the way out of this? As far as i am concerned, the most elegant one is
- to make the resource map load into the system heap. That's where all the
- resources are flagged to go. That's where all my code is. That's a heap that
- never collapses. Unfortunately, I cannot find anything written clearly enough
- for a fool like me to recognize as the way to get this to happen. The various
- chapters on the resource manager never talk about where the map goes, and in
- fact mislead one as to just how the resource mnager handles multiple open
- files. (There are actually TWO linked lists of maps maintained) Can anyone
- advise on this?
-
-
- Bill Stewart-Cole
-