Commit 77d10a1b by Joseph Myers Committed by Joseph Myers

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
parent 1d93fa5c
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
......
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment