Mail Archives: djgpp-workers/2002/05/17/13:26:09
> However if something else effectively calls sbrk with a negative
> value, nmalloc may later think it has a new noncontiguous block,
> and may then very well allocate the same space twice!. This would
> NOT be good.
If someone calls sbrk() with a negative value, they are deallocating
memory. This isn't any different than doing
for(i=4096;i<bigvalue;i++)
free(i);
Yes, you can do stupid things to kill your program.
feeding sbrk() negative values has valid uses, but it's a rare thing
that would only be used carefully.
> It cannot be protected by insisting on monatonic increasing, since
> I found that the startup code does some wierd things and leaves
> things fragmented before the application starts.
DPMI may also return memory blocks without being monatonic increasing.
- Raw text -