1 /* go-type-identity.c -- hash and equality identity functions.
3 Copyright 2009 The Go Authors. All rights reserved.
4 Use of this source code is governed by a BSD-style
5 license that can be found in the LICENSE file. */
12 /* The hash functions for types that can compare as identity is
15 extern uintptr
runtime_memhash(void *, uintptr
, uintptr
)
16 __asm__ (GOSYM_PREFIX
"runtime.memhash");
18 const FuncVal __go_type_hash_identity_descriptor
=
19 { (void *) runtime_memhash
};
21 /* An identity equality function for a type. This is used for types
22 where we can check for equality by checking that the values have
26 __go_type_equal_identity (const void *k1
, const void *k2
, uintptr_t key_size
)
28 return __builtin_memcmp (k1
, k2
, key_size
) == 0;
31 const FuncVal __go_type_equal_identity_descriptor
=
32 { (void *) __go_type_equal_identity
};