1 /* go-unsafe-pointer.c -- unsafe.Pointer type descriptor for Go.
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 /* This file provides the type descriptor for the unsafe.Pointer type.
13 The unsafe package is defined by the compiler itself, which means
14 that there is no package to compile to define the type
17 extern const struct __go_type_descriptor unsafe_Pointer
18 __asm__ (GOSYM_PREFIX "__go_tdn_unsafe.Pointer");
20 /* Used to determine the field alignment. */
27 /* The reflection string. */
28 #define REFLECTION "unsafe.Pointer"
29 static const String reflection_string =
31 (const byte *) REFLECTION,
35 const struct __go_type_descriptor unsafe_Pointer =
42 offsetof (struct field_align, p) - 1,
48 __go_type_hash_identity,
50 __go_type_equal_identity,
55 /* __pointer_to_this */
59 /* We also need the type descriptor for the pointer to unsafe.Pointer,
60 since any package which refers to that type descriptor will expect
61 it to be defined elsewhere. */
63 extern const struct __go_ptr_type pointer_unsafe_Pointer
64 __asm__ (GOSYM_PREFIX "__go_td_pN14_unsafe.Pointer");
66 /* The reflection string. */
67 #define PREFLECTION "*unsafe.Pointer"
68 static const String preflection_string =
70 (const byte *) PREFLECTION,
71 sizeof PREFLECTION - 1,
74 const struct __go_ptr_type pointer_unsafe_Pointer =
83 offsetof (struct field_align, p) - 1,
89 __go_type_hash_identity,
91 __go_type_equal_identity,
96 /* __pointer_to_this */