go-copy.c 631 B

1234567891011121314151617181920212223
  1. /* go-append.c -- the go builtin copy function.
  2. Copyright 2010 The Go Authors. All rights reserved.
  3. Use of this source code is governed by a BSD-style
  4. license that can be found in the LICENSE file. */
  5. #include <stddef.h>
  6. #include <stdint.h>
  7. /* We should be OK if we don't split the stack here, since we are just
  8. calling memmove which shouldn't need much stack. If we don't do
  9. this we will always split the stack, because of memmove. */
  10. extern void
  11. __go_copy (void *, void *, uintptr_t)
  12. __attribute__ ((no_split_stack));
  13. void
  14. __go_copy (void *a, void *b, uintptr_t len)
  15. {
  16. __builtin_memmove (a, b, len);
  17. }