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