summaryrefslogtreecommitdiff
path: root/libgo/runtime/go-unsafe-pointer.c
diff options
context:
space:
mode:
Diffstat (limited to 'libgo/runtime/go-unsafe-pointer.c')
-rw-r--r--libgo/runtime/go-unsafe-pointer.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/libgo/runtime/go-unsafe-pointer.c b/libgo/runtime/go-unsafe-pointer.c
index b71804ac741..67b2999df5d 100644
--- a/libgo/runtime/go-unsafe-pointer.c
+++ b/libgo/runtime/go-unsafe-pointer.c
@@ -8,6 +8,7 @@
#include "runtime.h"
#include "go-type.h"
+#include "mgc0.h"
/* A pointer with a zero value. */
static void *zero_pointer;
@@ -20,6 +21,9 @@ static void *zero_pointer;
extern const struct __go_type_descriptor unsafe_Pointer
__asm__ (GOSYM_PREFIX "__go_tdn_unsafe.Pointer");
+extern const uintptr unsafe_Pointer_gc[]
+ __asm__ (GOSYM_PREFIX "__go_tdn_unsafe.Pointer$gc");
+
/* Used to determine the field alignment. */
struct field_align
{
@@ -35,6 +39,8 @@ static const String reflection_string =
sizeof REFLECTION - 1
};
+const uintptr unsafe_Pointer_gc[] = {8, GC_APTR, 0, GC_END};
+
const struct __go_type_descriptor unsafe_Pointer =
{
/* __code */
@@ -51,6 +57,8 @@ const struct __go_type_descriptor unsafe_Pointer =
__go_type_hash_identity,
/* __equalfn */
__go_type_equal_identity,
+ /* __gc */
+ unsafe_Pointer_gc,
/* __reflection */
&reflection_string,
/* __uncommon */
@@ -94,6 +102,8 @@ const struct __go_ptr_type pointer_unsafe_Pointer =
__go_type_hash_identity,
/* __equalfn */
__go_type_equal_identity,
+ /* __gc */
+ unsafe_Pointer_gc,
/* __reflection */
&preflection_string,
/* __uncommon */