diff options
| author | Michael Matloob <matloob@golang.org> | 2015-11-11 12:39:30 -0500 |
|---|---|---|
| committer | Michael Matloob <matloob@golang.org> | 2015-11-12 17:04:45 +0000 |
| commit | 432cb66f16b2bb6a167725057168bbe4aefe5fb5 (patch) | |
| tree | 0a6aaf45df2810dc7276212496a4b647ed0bb6d2 /src/runtime/runtime1.go | |
| parent | b5a0c67fcc2f87b5e2fd04e023f9a0b2f3d759da (diff) | |
| download | go-432cb66f16b2bb6a167725057168bbe4aefe5fb5.tar.xz | |
runtime: break out system-specific constants into package sys
runtime/internal/sys will hold system-, architecture- and config-
specific constants.
Updates #11647
Change-Id: I6db29c312556087a42e8d2bdd9af40d157c56b54
Reviewed-on: https://go-review.googlesource.com/16817
Reviewed-by: Russ Cox <rsc@golang.org>
Diffstat (limited to 'src/runtime/runtime1.go')
| -rw-r--r-- | src/runtime/runtime1.go | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/runtime/runtime1.go b/src/runtime/runtime1.go index 9a468443fd..4c0242350c 100644 --- a/src/runtime/runtime1.go +++ b/src/runtime/runtime1.go @@ -6,6 +6,7 @@ package runtime import ( "runtime/internal/atomic" + "runtime/internal/sys" "unsafe" ) @@ -52,7 +53,7 @@ var ( // nosplit for use in linux/386 startup linux_setup_vdso //go:nosplit func argv_index(argv **byte, i int32) *byte { - return *(**byte)(add(unsafe.Pointer(argv), uintptr(i)*ptrSize)) + return *(**byte)(add(unsafe.Pointer(argv), uintptr(i)*sys.PtrSize)) } func args(c int32, v **byte) { @@ -192,10 +193,10 @@ func check() { if unsafe.Sizeof(j) != 8 { throw("bad j") } - if unsafe.Sizeof(k) != ptrSize { + if unsafe.Sizeof(k) != sys.PtrSize { throw("bad k") } - if unsafe.Sizeof(l) != ptrSize { + if unsafe.Sizeof(l) != sys.PtrSize { throw("bad l") } if unsafe.Sizeof(x1) != 1 { @@ -238,7 +239,7 @@ func check() { } k = unsafe.Pointer(uintptr(0xfedcb123)) - if ptrSize == 8 { + if sys.PtrSize == 8 { k = unsafe.Pointer(uintptr(unsafe.Pointer(k)) << 10) } if casp(&k, nil, nil) { |
