mirror of git://gcc.gnu.org/git/gcc.git
* xmemdup.c, xstrdup.c: Expose the tail call.
From-SVN: r97033
This commit is contained in:
parent
cba9e10abb
commit
bb99744fd4
|
@ -1,3 +1,7 @@
|
||||||
|
2005-03-24 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
|
||||||
|
|
||||||
|
* xmemdup.c, xstrdup.c: Expose the tail call.
|
||||||
|
|
||||||
2005-03-09 Mark Mitchell <mark@codesourcery.com>
|
2005-03-09 Mark Mitchell <mark@codesourcery.com>
|
||||||
|
|
||||||
* configure.ac (funcs): Add gettimeofday.
|
* configure.ac (funcs): Add gettimeofday.
|
||||||
|
|
|
@ -24,6 +24,10 @@ allocated, the remaining memory is zeroed.
|
||||||
#include <sys/types.h> /* For size_t. */
|
#include <sys/types.h> /* For size_t. */
|
||||||
#ifdef HAVE_STRING_H
|
#ifdef HAVE_STRING_H
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
#else
|
||||||
|
# ifdef HAVE_STRINGS_H
|
||||||
|
# include <strings.h>
|
||||||
|
# endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
PTR
|
PTR
|
||||||
|
@ -33,6 +37,5 @@ xmemdup (input, copy_size, alloc_size)
|
||||||
size_t alloc_size;
|
size_t alloc_size;
|
||||||
{
|
{
|
||||||
PTR output = xcalloc (1, alloc_size);
|
PTR output = xcalloc (1, alloc_size);
|
||||||
memcpy (output, input, copy_size);
|
return (PTR) memcpy (output, input, copy_size);
|
||||||
return output;
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,6 +19,10 @@ obtain memory.
|
||||||
#endif
|
#endif
|
||||||
#ifdef HAVE_STRING_H
|
#ifdef HAVE_STRING_H
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
#else
|
||||||
|
# ifdef HAVE_STRINGS_H
|
||||||
|
# include <strings.h>
|
||||||
|
# endif
|
||||||
#endif
|
#endif
|
||||||
#include "ansidecl.h"
|
#include "ansidecl.h"
|
||||||
#include "libiberty.h"
|
#include "libiberty.h"
|
||||||
|
@ -29,6 +33,5 @@ xstrdup (s)
|
||||||
{
|
{
|
||||||
register size_t len = strlen (s) + 1;
|
register size_t len = strlen (s) + 1;
|
||||||
register char *ret = xmalloc (len);
|
register char *ret = xmalloc (len);
|
||||||
memcpy (ret, s, len);
|
return (char *) memcpy (ret, s, len);
|
||||||
return ret;
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue