From: Paul Shirley Newsgroups: comp.os.msdos.djgpp Subject: Re: Virutal memory problems. Date: Mon, 21 Oct 1996 23:30:43 +0100 Organization: DrinkSoft Lines: 23 Distribution: world Message-ID: References: <845921032 DOT 28340 DOT 0 AT abwillms DOT demon DOT co DOT uk> NNTP-Posting-Host: chocolat.foobar.co.uk Mime-Version: 1.0 To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp In article <845921032 DOT 28340 DOT 0 AT abwillms DOT demon DOT co DOT uk>, "Alaric B. Williams" writes >How serious is that power-of-two waste - in that is it then free for >the next allocation to be taken from (ie if I then request 32-18 = >14Mb will it not 'allocate' any more), or is it really that bad? In one sense it really is wasted, the block is allocated and you won't suddenly find it reused. However virtual memory paging will almost certainly scavenge the unused pages if required, though frankly I prefer to avoid the wastage in the first place. > >If so, what's the point? Surely it's no slower to allocate to the >nearest word? The binary bin algorithm used is *incredibly* fast at allocating memory, and on machines with properly implemented virtual memory not necessarily wasteful. It also avoid memory fragmentation. Allocating to the nearest word is harder to manage. It is of course possible to substitute your own malloc routine ;) -- Paul Shirley