go-memequal.c 464 B

1234567891011121314151617
  1. /* go-memequal.c -- compare memory buffers for equality
  2. Copyright 2016 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 "runtime.h"
  6. _Bool memequal (void *, void *, uintptr)
  7. __asm__ (GOSYM_PREFIX "runtime.memequal")
  8. __attribute__ ((no_split_stack));
  9. _Bool
  10. memequal (void *p1, void *p2, uintptr len)
  11. {
  12. return __builtin_memcmp (p1, p2, len) == 0;
  13. }