diff options
author | Joseph Myers <joseph@codesourcery.com> | 2015-02-17 16:19:56 +0000 |
---|---|---|
committer | Joseph Myers <jsm28@gcc.gnu.org> | 2015-02-17 16:19:56 +0000 |
commit | 77d10a1b208d0e78ee638a49952276be9b830db4 (patch) | |
tree | 4aba793faea5f0c0e6b31efb9fae3b9b7af9fd00 /libgcc | |
parent | 1d93fa5c1b05abc3eeeaa9a9d1a8520fd068f65e (diff) | |
download | gcc-77d10a1b208d0e78ee638a49952276be9b830db4.zip gcc-77d10a1b208d0e78ee638a49952276be9b830db4.tar.gz gcc-77d10a1b208d0e78ee638a49952276be9b830db4.tar.bz2 |
Avoid dependence on libc headers in nvptx realloc.
* config/nvptx/realloc.c: Include <stddef.h> instead of <stdlib.h>
and <string.h>.
(__nvptx_realloc): Call __builtin_memcpy instead of memcpy.
From-SVN: r220764
Diffstat (limited to 'libgcc')
-rw-r--r-- | libgcc/ChangeLog | 6 | ||||
-rw-r--r-- | libgcc/config/nvptx/realloc.c | 5 |
2 files changed, 8 insertions, 3 deletions
diff --git a/libgcc/ChangeLog b/libgcc/ChangeLog index 2c9b6e8..0bff7ef 100644 --- a/libgcc/ChangeLog +++ b/libgcc/ChangeLog @@ -1,3 +1,9 @@ +2015-02-17 Joseph Myers <joseph@codesourcery.com> + + * config/nvptx/realloc.c: Include <stddef.h> instead of <stdlib.h> + and <string.h>. + (__nvptx_realloc): Call __builtin_memcpy instead of memcpy. + 2015-02-10 Rainer Emrich <rainer@emrich-ebersheim.de> PR gcov-profile/61889 diff --git a/libgcc/config/nvptx/realloc.c b/libgcc/config/nvptx/realloc.c index 5b4a9a4..136f010 100644 --- a/libgcc/config/nvptx/realloc.c +++ b/libgcc/config/nvptx/realloc.c @@ -21,8 +21,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see <http://www.gnu.org/licenses/>. */ -#include <stdlib.h> -#include <string.h> +#include <stddef.h> #include "nvptx-malloc.h" void * @@ -44,7 +43,7 @@ __nvptx_realloc (void *ptr, size_t newsz) oldsz = *sp; } if (oldsz != 0) - memcpy (newptr, ptr, oldsz > newsz ? newsz : oldsz); + __builtin_memcpy (newptr, ptr, oldsz > newsz ? newsz : oldsz); __nvptx_free (ptr); return newptr; |