aboutsummaryrefslogtreecommitdiff
path: root/libgcc/config/nvptx
diff options
context:
space:
mode:
authorJoseph Myers <joseph@codesourcery.com>2015-02-17 16:19:56 +0000
committerJoseph Myers <jsm28@gcc.gnu.org>2015-02-17 16:19:56 +0000
commit77d10a1b208d0e78ee638a49952276be9b830db4 (patch)
tree4aba793faea5f0c0e6b31efb9fae3b9b7af9fd00 /libgcc/config/nvptx
parent1d93fa5c1b05abc3eeeaa9a9d1a8520fd068f65e (diff)
downloadgcc-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/config/nvptx')
-rw-r--r--libgcc/config/nvptx/realloc.c5
1 files changed, 2 insertions, 3 deletions
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;