delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/2003/05/02/17:51:27

Date: Sat, 03 May 2003 00:48:11 +0300
From: "Eli Zaretskii" <eliz AT elta DOT co DOT il>
Sender: halo1 AT zahav DOT net DOT il
To: djgpp-workers AT delorie DOT com
Message-Id: <2110-Sat03May2003004811+0300-eliz@elta.co.il>
X-Mailer: emacs 21.3.50 (via feedmail 8 I) and Blat ver 1.8.9
In-reply-to: <3EB2B5C0.987AC700@yahoo.com> (message from CBFalconer on Fri, 02
May 2003 14:15:28 -0400)
Subject: Re: nmalloc documentation revisions
References: <3EAF5020 DOT 9E3C6C9A AT yahoo DOT com> <7458-Wed30Apr2003210444+0300-eliz AT elta DOT co DOT il> <3EB08219 DOT 3D55D32A AT yahoo DOT com> <3EB1555C DOT D52AC0B6 AT yahoo DOT com> <3EB2B5C0 DOT 987AC700 AT yahoo DOT com>
Reply-To: djgpp-workers AT delorie DOT com
Errors-To: nobody AT delorie DOT com
X-Mailing-List: djgpp-workers AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

> Date: Fri, 02 May 2003 14:15:28 -0400
> From: CBFalconer <cbfalconer AT yahoo DOT com>
> 
> On looking things over, I think that the test for oversize
> allocations should also be done for realloc, and that the
> malloc_fail hook should also be called for realloc_failure.  The
> hook can tell the difference by the non-NULLness of ptr.

In the old malloc, realloc always called malloc whenever the
allocation was about to grow, and so these tests were not required in
realloc as malloc would do that anyway.  If your code can grow an
allocation without calling malloc in the process, malloc_fail hook
should indeed be called in realloc, and likewise for the
preposterously large allocations.

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019