home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / comp / sys / mac / programm / 20567 < prev    next >
Encoding:
Text File  |  1993-01-03  |  2.2 KB  |  41 lines

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