Mail Archives: djgpp/1996/07/01/21:28:35
> Yes, I see the point, thanks for the flag, I'll use it. Has this behaviour
> changed because of the new ANSI standard ?
ANSI never said you could assume anything about malloc(). Even if we
zeroed the sbrk() memory, a malloc that reuses a block of memory will
normally get the old values. Some debugging malloc packages will
pre-fill malloc'd blocks with obviously invalid numbers to help debug
this.
Previously, sbrk() memory was zeroed because this is apparently what
unix did. For security reasons, it couldn't let you have whatever the
previous process left in it. It had to be set to *something*.
However, this zeroing is very expensive for well-written programs, and
one commercial program using djgpp saw a large performance boost when
we took the zeroing out. So, we took it out. We added the flags to
help people deal with ill-behaved programs.
- Raw text -