Date: Thu, 20 Aug 1998 11:42:02 -0700 From: "Jordan K. Hubbard" <jkh@time.cdrom.com> To: dag-erli@ifi.uio.no (Dag-Erling Coidan =?iso-8859-1?Q?Sm=F8rgrav?= ) Cc: Warner Losh <imp@village.org>, hackers@FreeBSD.ORG Subject: Re: Realloc fix for review Message-ID: <25422.903638522@time.cdrom.com> In-Reply-To: Your message of "20 Aug 1998 16:48:46 -0000." <xzplnoj8uq9.fsf@skejdbrimir.ifi.uio.no>
next in thread | previous in thread | raw e-mail | index | archive | help
> Is that really a good idea? If you free the old block when realloc() > fails, you lose whatever data was in it (and therefore potentially > lose the ability to generate a sensible error message or recover > gracefully). Such a change should be done on a per-case basis, rather > than blindly applied to every snippet that calls realloc(). Hmmm. In my previous message, I'd also assumed that Warner was only talking about changing instances of realloc() where the application very definitely wanted the free-on-failure behavior. Replacing every instance of realloc() with the new call would, indeed, be evil incarnate given realloc()'s well-documented "I don't fondle the previous value on failure" behavior. Heck, I thought that was the entire reason for a new call in the first place. :-) - Jordan To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?25422.903638522>