X-Authentication-Warning: delorie.com: mailnull set sender to djgpp-bounces using -f Message-ID: <3C645F1D.C26E8F64@yahoo.com> From: CBFalconer Organization: Ched Research X-Mailer: Mozilla 4.75 [en] (Win98; U) X-Accept-Language: en MIME-Version: 1.0 Newsgroups: comp.os.msdos.djgpp Subject: Re: Alignment problem References: <0BA32251E589D2118EA60008C70DDCAB025F91A5 AT JNJFRISEXS1 DOT eu DOT jnj DOT com> <3C63F73A DOT 3FEF6F56 AT cyberoptics DOT com> <3c63f21f DOT sandmann AT clio DOT rice DOT edu> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Lines: 35 Date: Sat, 09 Feb 2002 00:19:09 GMT NNTP-Posting-Host: 12.90.169.246 X-Complaints-To: abuse AT worldnet DOT att DOT net X-Trace: bgtnsc05-news.ops.worldnet.att.net 1013213949 12.90.169.246 (Sat, 09 Feb 2002 00:19:09 GMT) NNTP-Posting-Date: Sat, 09 Feb 2002 00:19:09 GMT To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com Charles Sandmann wrote: > > > A note to those attempting to reproduce these problems: the alignments > > seem to be random, so that a single trial of the program is > > insufficient. After several runs, I was about to conclude that the > > pointers *were* properly aligned under Win95, until I closed the DOS > > box, ran and closed a Windows program, opened a new DOS box, and ran my > > program again. Then the pointers were only 4-byte aligned. > > I suspect the alignment changes depending on the sbrk() return value to > the first time malloc() builds it's memory. > > sbrk() can also return non-contiguous blocks at times which malloc() may > not handle well. (This can be based on what Win95 would return, so it > can make the behavior unpredictable itself). > > I agree that malloc() should do a better job for best performance. If > someone posts a fix to malloc it will get into a new version faster - > else it will be fixed when someone has the time and motivation to > look at it. > > Thanks for reporting this. A while ago I also reported a problem with freeing many items in no particular order. It became highly noticeable at about 20,000 items on my machine, and impossible by 50,000. If you want code to provoke it I can provide it. LCC-Win32 acts the same way, but the limit is much higher under VC6. -- 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)