X-Authentication-Warning: delorie.com: mailnull set sender to djgpp-workers-bounces using -f Message-ID: <3C734B2D.F82A42FB@yahoo.com> Date: Wed, 20 Feb 2002 02:07:25 -0500 From: CBFalconer Organization: Ched Research X-Mailer: Mozilla 4.75 [en] (Win98; U) X-Accept-Language: en MIME-Version: 1.0 To: djgpp-workers AT delorie DOT com Subject: Re: Malloc/free DJGPP code References: <10202200445 DOT AA15769 AT clio DOT rice DOT edu> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Reply-To: djgpp-workers AT delorie DOT com Charles Sandmann wrote: > > > If sbrk alignment is controlled malloc alignment is controlled. > > Pick a size. > > sbrk() alignment is NOT controlled - it is up to malloc to to do > the alignment. Alignment should be on an 8 byte boundary to > maximize performance with floating point arrays. The overhead per > block must be a multiple of 8 bytes (at a minimum) to keep the > blocks aligned. Larger alignments might add value but not proven. > ... snip ... > > I posted both; little feedback on which should be committed. But it's > important that the block overhead be a factor of the alignment or you > will almost never merge blocks. Important to know. I would suggest always requesting at least ALIGN more than needed, so that an unexpected sbrk can be truncated. Expected sbrks simply extend the size of the current lastsbrk, and are automatically aligned. Unexpected ones have no bottom adjacencies anyhow. Once the correction is made in the first expected sbrk all will be quiet until the next unexpected. That leaves the wastage at the bottom of a connected group. How does my proposal for matching the unclean linkages look, hopefully by just matching the offset of the size component? I gather ALIGN = 8 is needed. I had assumed 4 from the action of the present system. -- Chuck F (cbfalconer AT yahoo DOT com) (cbfalconer AT XXXXworldnet DOT att DOT net) Available for consulting/temporary embedded and systems. (Remove "XXXX" from reply address. yahoo works unmodified) mailto:uce AT ftc DOT gov (for spambots to harvest)