Path: utzoo!utgpu!water!watmath!clyde!att!osu-cis!tut.cis.ohio-state.edu!mailrus!purdue!decwrl!mejac!gryphon!amy!hansel From: hansel@amy.uucp (Steve Hansel) Newsgroups: comp.sys.amiga.tech Subject: Re:Re: free memory defragmentation Message-ID: <7354@amy.uucp> Date: 22 Oct 88 18:17:28 GMT References: <9887@cup.portal.com> Reply-To: hansel@amy.uucp Organization: Hansel-Graphics Lines: 36 > I am pretty sure that this IS done with a normal FreeMem call since > the nodes in the memory free list ARE sorted and we get big chunks > of free memory if we free small adjacent blocks before. > The problem of fragmentation is another one. It is not small adjacent > blocks that aren't concatenated BUT small NOT adjacent blocks that > can't be concatenated. How about allocating 'small' chunks from the top of memory downward and 'large' chunks from the bottom of memory upward. This would mean that, unless your memory was very full,the fragmentation would only occur between small chunks. I bet this could be done with a minimum of overhead. The biggest impact would probably be that the free list would be comprised of 12 byte blocks because it would be doubly linked. This shouldn't be a problem because there was never any guarantee on the minimum size of alloced blocks. Also future releases of the O.S. could have optional MEMF_PERM (or MEMF_LONGTERM) flag that would force the OS to allocate from the small chunk area (Top). This flag would be used by Clock programs, system monitors, shells, etc, when they AllocMemed because they tend to keep their memory for long periods of time. I think this approach is much easier than allocing larger chunks to hold smaller chunks, or using pointer handles. Just a thought Steve Hansel gryphon.cts.com!amy!hansel oberon.usc.edu!amy!hansel rutgers!amy!hansel