]> Cypherpunks repositories - gostls13.git/commitdiff
Add an intptr type to runtime; needed in FreeBSD
authorDevon H. O'Dell <devon.odell@gmail.com>
Wed, 18 Nov 2009 17:11:39 +0000 (09:11 -0800)
committerRuss Cox <rsc@golang.org>
Wed, 18 Nov 2009 17:11:39 +0000 (09:11 -0800)
In thread.c, we need to cast to whatever the native
size of intptr is on the system, but we only have
uintptr available. They're the same size, but can't
do signed casts without this one :).

R=rsc
CC=golang-dev
https://golang.org/cl/156073

src/pkg/runtime/freebsd/thread.c
src/pkg/runtime/runtime.h

index a4e1e13e513b0d1ab3ea5abbc4166ab913fdd81d..5f440223651d0eb3b90d9d68432845917e6916b4 100644 (file)
@@ -141,7 +141,7 @@ newosproc(M *m, G *g, void *stk, void (*fn)(void))
        param.arg = m;
        param.stack_base = stk;
        param.stack_size = g->stackbase - g->stackguard + 256;
-       param.child_tid = (int32*)&m->procid;
+       param.child_tid = (intptr*)&m->procid;
        param.parent_tid = nil;
        param.tls_base = (int8*)&m->tls[0];
        param.tls_size = sizeof m->tls;
index 83b47b7a331b88b0d4fd7e610f75c3587fdbf357..df1c45ae1f77a57522a720f92b6a0e64faeab684 100644 (file)
@@ -18,8 +18,10 @@ typedef      double                  float64;
 
 #ifdef _64BIT
 typedef        uint64          uintptr;
+typedef        int64           intptr;
 #else
 typedef        uint32          uintptr;
+typedef int32          intptr;
 #endif
 
 /*