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
This commit is contained in:
parent
1d93fa5c1b
commit
77d10a1b20
@ -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
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user