home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / comp / sys / amiga / programm / 12676 < prev    next >
Encoding:
Internet Message Format  |  1992-08-25  |  2.7 KB

  1. Path: sparky!uunet!uunet.ca!geac!aeshq!dgilbert
  2. From: dgilbert@aeshq.uucp (David Gilbert)
  3. Newsgroups: comp.sys.amiga.programmer
  4. Subject: Re: Program Fragmenting Memory
  5. Summary: Something you might try with #pragma's
  6. Keywords: amiga programmer hack
  7. Message-ID: <DGILBERT.92Aug24141943@aeshq.uucp>
  8. Date: 24 Aug 92 18:19:43 GMT
  9. References: <1992Aug9.023203.7467@ariel.ec.usf.edu>
  10. Sender: dgilbert@aeshq.UUCP
  11. Organization: Environment Canada --- Atmostpheric Environment Service
  12. Lines: 41
  13. In-reply-to: stelmack@eggo.tmc.edu's message of 9 Aug 92 02:32:03 GMT
  14.  
  15. >>>>> On 9 Aug 92 02:32:03 GMT, stelmack@eggo.tmc.edu (Gregory M. Stelmack) said:
  16.  
  17. Gregory> I've been trying to track this problem down for two days now,
  18. Gregory> so I ask here in case it has to do with something outside my
  19. Gregory> code.
  20.  
  21. Gregory> My latest project has been fragmenting memory, and leaving
  22. Gregory> two small chunks behind. Running MungWall & MungList (thanks
  23. Gregory> for Sushi!) reveals two tiny chunks unfreed by my task --
  24. Gregory> sizes $0a and $a8. Anyway, I wrote my own wrappers for
  25. Gregory> AllocMem and FreeMem that track the size and location of my
  26. Gregory> allocations, and replaced all my calls with these wrappers
  27. Gregory> (searching every source file to make sure I got them all).
  28. Gregory> When I run with these, I still lose memory, but all my Allocs
  29. Gregory> are properly matched by same-sized Frees (and MungWall does
  30. Gregory> not complain). Also, neither address for the fragments
  31. Gregory> matches any of my allocations.
  32.  
  33. Gregory> So, does anyone know of anything that might be causing this?
  34. Gregory> I am using SAS/C 5.10b, and will call SAS Monday to see if
  35. Gregory> there might be something with their startup/shutdown code,
  36. Gregory> but in the meantime am asking here.  Any ideas? Anyone know
  37. Gregory> of any other tools that might help me track this down?
  38.  
  39.     It might be something you're doing, but I can tell you what you
  40. can *probably* do.  Take a look at the #pragma for AllocMem() and
  41. FreeMem().  Make sure you're using these inline things.  Then make a
  42. copy of the include files and change the Pragmas to read
  43. ExecAllocMem() and ExecFreeMem().  If I'm right, the Lattice startup
  44. (and all of your code) should call AllocMem --- your function, which
  45. can still call ExecAllocMem()... and so on.  This would ensure you
  46. wrap ALL calls.  An alternative to this would be to SetFunction()
  47. AllocMem(), or to use Enforcer/Mungwall.
  48.  
  49. Dave.
  50.  
  51. --
  52. David C. L. Gilbert                        |  Something witty should be here. |
  53. dgilbert@aeshq.uucp -> this term           |                                  |
  54. dgilbert@snowhite.cis.uoguelph.ca -> next  |-->Only Amiga makes it possible   |
  55.     Environment Canada               term  |                                  |
  56.