home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / sys / amiga / programm / 12344 < prev    next >
Encoding:
Internet Message Format  |  1992-08-15  |  2.3 KB

  1. Path: sparky!uunet!cbmvax!andy
  2. From: andy@cbmvax.commodore.com (Andy Finkel)
  3. Newsgroups: comp.sys.amiga.programmer
  4. Subject: Re: Program Fragmenting Memory
  5. Message-ID: <34287@cbmvax.commodore.com>
  6. Date: 15 Aug 92 13:07:08 GMT
  7. References: <1992Aug9.023203.7467@ariel.ec.usf.edu> <rwm.713818561@atronx.OCUnix.On.Ca>
  8. Reply-To: andy@cbmvax.commodore.com (Andy Finkel)
  9. Organization: Flying Cat, Inc.
  10. Lines: 43
  11.  
  12. In article <rwm.713818561@atronx.OCUnix.On.Ca> rwm@atronx.OCUnix.On.Ca (Russell McOrmond) writes:
  13. >stelmack@eggo.tmc.edu (Gregory M. Stelmack) writes:
  14. >>I've been trying to track this problem down for two days now, so I ask here in
  15. >>case it has to do with something outside my code.
  16. >
  17. >  Do you by any chance use Amigados Local environment variables?  I've myself
  18. >been trying to track down a fragmentation problem in my own software, and I
  19. >can't find any of my own memory allocations that are causing the problem.
  20. >
  21. >  I haven't really spent a lot of time on it yet, so I'm not sure, but I'm
  22. >getting a little curious about whether or not local environment variables
  23. >are Free()'d when the process ends (IE: there is memory left over after I
  24. >exit the program).
  25.  
  26. Assuming you are running in the Shell process itself (ie you are not
  27. run, and don't detach) any local variables your program creates
  28. will still be there when your program exits.  The local variables
  29. are attached to the process structure.  When the process exits, then
  30. the local variables are all freed.  So if your program is RUN, you have
  31. your own process;  any local variables are freed on exit.  If you are
  32. running directly from the Shell, the local variables are attached to the
  33. Shell process structure, and will hang around until EndShell time.
  34.  
  35. The RC and RESULT2 shell variables are special.  When the Shell is started
  36. up, it creates blank variables;  it updates those return codes by writing
  37. directly into the variable's buffer, rather than dumping the old one and
  38. setting a new one.  It does this to avoid fragmentation.
  39.  
  40. >
  41. >>-- Greg Stelmack (stelmack@eggo.csee.usf.edu)
  42.  
  43. >  Russell McOrmond  rwm@Atronx.OCUnix.On.Ca Net Support:(613) 230-2282(V.32Bis)
  44.  
  45.  
  46.             andy
  47. -- 
  48. andy finkel        {uunet|rutgers|amiga}!cbmvax!andy
  49.  
  50. "C++ should really have been called D."
  51.  
  52.  
  53. Any expressed opinions are mine; but feel free to share.
  54. I disclaim all responsibilities, all shapes, all sizes, all colors.
  55.