1
0
mirror of https://github.com/golang/go synced 2024-11-25 00:07:56 -07:00

Add an intptr type to runtime; needed in FreeBSD

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
This commit is contained in:
Devon H. O'Dell 2009-11-18 09:11:39 -08:00 committed by Russ Cox
parent 43bcf47912
commit 659780b643
2 changed files with 3 additions and 1 deletions

View 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;

View File

@ -18,8 +18,10 @@ typedef double float64;
#ifdef _64BIT
typedef uint64 uintptr;
typedef int64 intptr;
#else
typedef uint32 uintptr;
typedef int32 intptr;
#endif
/*