Article View: gnu.emacs.bug
Article #98450xrealloc error in makeinfo, gcc, ...
From: S. Sullivan
Date: Wed, 12 Jun 1991 20:20
Date: Wed, 12 Jun 1991 20:20
25 lines
1170 bytes
1170 bytes
When passed a null pointer, xrealloc croaks on SunOS 4.1.1B.
Solution:
Make xrealloc read:
/* Like realloc (), but barfs if there isn't enough memory. */
char *
xrealloc (pointer, nbytes)
char *pointer;
int nbytes;
{
if (!pointer) return (xmalloc( nbytes)); /* use malloc if NULL pointer */
pointer = (char *) realloc (pointer, nbytes);
if (!pointer)
{
error ("Virtual memory exhausted in realloc ().");
abort ();
}
return (pointer);
}
This seems to work well.
Steve Sullivan
sullivan@csn.org
Technical Details
Message-ID:
<9106122020.AA00836@thurber.Mathcom.com>Path:
arc1-ca.pugleaf.net!gmdzi!unido!mcsun!uunet!cis.ohio-state.edu!tut.cis.ohio-state.edu!unreplyable!garbageShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fb2f1,cad6bc8912292326,start X-Google-Attributes: gidfb2f1,public X-Google-ArrivalTime: 1991-06-12 13:20:47 PST Path: arc1-ca.pugleaf.net!gmdzi!unido!mcsun!uunet!cis.ohio-state.edu!tut.cis.ohio-state.edu!unreplyable!garbage From: sullivan@mathcom.com (S. Sullivan) Newsgroups: gnu.emacs.bug Subject: xrealloc error in makeinfo, gcc, ... Message-ID: <9106122020.AA00836@thurber.Mathcom.com> Date: 12 Jun 91 20:20:47 GMT Sender: daemon@tut.cis.ohio-state.edu Distribution: gnu Organization: GNUs Not Usenet Lines: 25 Approved: bug-gnu-emacs@prep.ai.mit.edu