Mail Archives: djgpp/2002/02/08/19:30:20
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)
- Raw text -