Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uunet!medar!jseymour From: jseymour@medar.com (James Seymour) Newsgroups: comp.sys.amiga.programmer Subject: Re: Memory fragging Message-ID: <1991May23.114423.11039@medar.com> Date: 23 May 91 11:44:23 GMT References: <1991May21.195251.16477@zorch.SF-Bay.ORG> <21795@cbmvax.commodore.com> Organization: Medar, Inc. Farmington Hills, MI Lines: 37 In article <21795@cbmvax.commodore.com> peter@cbmvax.commodore.com (Peter Cherna) writes: :In article <1991May21.195251.16477@zorch.SF-Bay.ORG> mike@zorch.SF-Bay.ORG (Mike Smithwick) writes: ::[Attack of the killer poodles!] :: ::I am using loads of chip ram and it seems to be fragging pretty badly. So much ::so that I can't run the program more than a couple of times without having ::to reboot. I am not running any other programs at the same time so there is ::no outside interference. Theoretically I should return to the same state ::as I had before, I am not. : :Do as much as you can to free your resources in the reverse order that :you obtained them in. Avoid using FreeRemember(FALSE). Avoid :doing Alloc(A);Alloc(B);Alloc(C), ... , Free(B). : But if you eventually F/free() the other two, the three chunks of memory (in the above example) will be coalesced by the o/s, won't they? (Assuming no intervening allocations that haven't been free'd.) In other words, if I run multiple processes, each doing any number of memory allocs in any order, providing they all properly free the memory before terminating, AmigaDOS will coalesce all of the adjacent free'd spaces won't it? May sound like a stupid question, but the way Peter phrased his answer, I had to ask. [I'd RTFM, but it hasn't been published/released yet :-)] : : Peter :-- :"If all you have is a hammer, everything looks like a nail." Every time I see this .sig line, I think of the poor souls that think Windows (tm) is representative of what the rest of us mean by multi-tasking. -- Jim Seymour | Medar, Inc. ...!uunet!medar!jseymour | 38700 Grand River Ave. jseymour@medar.com | Farmington Hills, MI. 48331 CIS: 72730,1166 GEnie: jseymour | FAX: (313)477-8897