diff options
| author | Russ Cox <rsc@golang.org> | 2012-09-24 14:58:34 -0400 |
|---|---|---|
| committer | Russ Cox <rsc@golang.org> | 2012-09-24 14:58:34 -0400 |
| commit | 0b08c9483f5f447083616b7b5e6ddf04edffc379 (patch) | |
| tree | 84860615deb2e8ec6854c15632b2e879deb25cf4 /src/pkg/runtime/malloc.h | |
| parent | 5e3fb887a3a9faf6fac1cd227d4b6b66bef9225a (diff) | |
| download | go-0b08c9483f5f447083616b7b5e6ddf04edffc379.tar.xz | |
runtime: prepare for 64-bit ints
This CL makes the runtime understand that the type of
the len or cap of a map, slice, or string is 'int', not 'int32',
and it is also careful to distinguish between function arguments
and results of type 'int' vs type 'int32'.
In the runtime, the new typedefs 'intgo' and 'uintgo' refer
to Go int and uint. The C types int and uint continue to be
unavailable (cause intentional compile errors).
This CL does not change the meaning of int, but it should make
the eventual change of the meaning of int on amd64 a bit
smoother.
Update #2188.
R=iant, r, dave, remyoudompheng
CC=golang-dev
https://golang.org/cl/6551067
Diffstat (limited to 'src/pkg/runtime/malloc.h')
| -rw-r--r-- | src/pkg/runtime/malloc.h | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/pkg/runtime/malloc.h b/src/pkg/runtime/malloc.h index fee6e01789..c00bd4599f 100644 --- a/src/pkg/runtime/malloc.h +++ b/src/pkg/runtime/malloc.h @@ -128,6 +128,15 @@ enum MaxGcproc = 8, }; +// Maximum memory allocation size, a hint for callers. +// This must be a #define instead of an enum because it +// is so large. +#ifdef _64BIT +#define MaxMem (16ULL<<30) /* 16 GB */ +#else +#define MaxMem ((uintptr)-1) +#endif + // A generic linked list of blocks. (Typically the block is bigger than sizeof(MLink).) struct MLink { @@ -418,5 +427,5 @@ int32 runtime·gcprocs(void); void runtime·helpgc(int32 nproc); void runtime·gchelper(void); -bool runtime·getfinalizer(void *p, bool del, void (**fn)(void*), int32 *nret); +bool runtime·getfinalizer(void *p, bool del, void (**fn)(void*), uintptr *nret); void runtime·walkfintab(void (*fn)(void*)); |
