gencheck.c, [...]: Don't define xmalloc.

* gencheck.c, gengenrtl.c: Don't define xmalloc.
	* gensupport.c: Don't define xstrdup, xcalloc, xrealloc,
	xmalloc.
	* f/fini.c: Use xmalloc.

From-SVN: r47506
This commit is contained in:
Zack Weinberg 2001-12-01 08:16:25 +00:00 committed by Zack Weinberg
parent af46cdde20
commit cfc45fb499
6 changed files with 11 additions and 92 deletions

View File

@ -1,3 +1,9 @@
2001-12-01 Zack Weinberg <zack@codesourcery.com>
* gencheck.c, gengenrtl.c: Don't define xmalloc.
* gensupport.c: Don't define xstrdup, xcalloc, xrealloc,
xmalloc.
2001-11-30 John David Anglin <dave@hiauly1.hia.nrc.ca>
* pa.c (output_ascii): Cast `p' to unsigned char.

View File

@ -1,3 +1,7 @@
2001-12-01 Zack Weinberg <zack@codesourcery.com>
* f/fini.c: Use xmalloc.
Fri Nov 30 20:54:02 2001 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* Make-lang.in: Delete references to proj.[co], proj-h.[co].

View File

@ -367,7 +367,7 @@ main (int argc, char **argv)
/* Make new name object to store name and its keyword. */
newname = (name) really_call_malloc (sizeof (*newname));
newname = (name) xmalloc (sizeof (*newname));
newname->namelen = strlen (buf);
newname->kwlen = strlen (kwname);
total_length = newname->kwlen + fixlengths;

View File

@ -70,24 +70,3 @@ main (argc, argv)
puts ("\n#endif /* GCC_TREE_CHECK_H */");
return 0;
}
#if defined(USE_C_ALLOCA)
/* FIXME: We only need an xmalloc definition because we are forced to
link with alloca.o on some platforms. This should go away if/when
we link against libiberty.a. (ghazi@caip.rutgers.edu 6/3/98) */
PTR
xmalloc (nbytes)
size_t nbytes;
{
PTR tmp = (PTR) really_call_malloc (nbytes);
if (!tmp)
{
fprintf (stderr, "can't allocate %d bytes (out of virtual memory)\n",
nbytes);
exit (FATAL_EXIT_CODE);
}
return tmp;
}
#endif /* USE_C_ALLOCA */

View File

@ -390,24 +390,6 @@ gencode ()
gendef (*fmt);
}
#if defined(USE_C_ALLOCA)
PTR
xmalloc (nbytes)
size_t nbytes;
{
PTR tmp = (PTR) really_call_malloc (nbytes);
if (!tmp)
{
fprintf (stderr, "can't allocate %d bytes (out of virtual memory)\n",
nbytes);
exit (FATAL_EXIT_CODE);
}
return tmp;
}
#endif /* USE_C_ALLOCA */
/* This is the main program. We accept only one argument, "-h", which
says we are writing the genrtl.h file. Otherwise we are writing the
genrtl.c file. */

View File

@ -1102,55 +1102,3 @@ read_md_rtx (lineno, seqnr)
return desc;
}
/* Until we can use the versions in libiberty. */
char *
xstrdup (input)
const char *input;
{
size_t len = strlen (input) + 1;
char *output = xmalloc (len);
memcpy (output, input, len);
return output;
}
PTR
xcalloc (nelem, elsize)
size_t nelem, elsize;
{
PTR newmem;
if (nelem == 0 || elsize == 0)
nelem = elsize = 1;
newmem = really_call_calloc (nelem, elsize);
if (!newmem)
fatal ("virtual memory exhausted");
return (newmem);
}
PTR
xrealloc (old, size)
PTR old;
size_t size;
{
PTR ptr;
if (old)
ptr = (PTR) really_call_realloc (old, size);
else
ptr = (PTR) really_call_malloc (size);
if (!ptr)
fatal ("virtual memory exhausted");
return ptr;
}
PTR
xmalloc (size)
size_t size;
{
PTR val = (PTR) really_call_malloc (size);
if (val == 0)
fatal ("virtual memory exhausted");
return val;
}