Date: Mon, 1 Jul 1996 21:24:43 -0400 Message-Id: <199607020124.VAA05192@delorie.com> From: DJ Delorie To: Kay AT jocokko DOT edition DOT bonbit DOT org CC: djgpp AT delorie DOT com In-reply-to: <6C0AM0qxr5B@jocokko.edition.bonbit.org> (Kay AT jocokko DOT edition DOT bonbit DOT org) Subject: Re: Extenders > 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.