]> Cypherpunks repositories - gostls13.git/commit
runtime: introduce and consistently use setNsec for timespec
authorIan Lance Taylor <iant@golang.org>
Thu, 14 Mar 2019 01:56:37 +0000 (18:56 -0700)
committerIan Lance Taylor <iant@golang.org>
Fri, 15 Mar 2019 03:37:49 +0000 (03:37 +0000)
commit0a7bc8f430e3e4017910780a898a5f20d337895b
tree05de8f86002d9e9313331d1c917fe88925625b81
parent829c140f149dba8933dea0cead3a78de4c83b529
runtime: introduce and consistently use setNsec for timespec

The general code for setting a timespec value sometimes used set_nsec
and sometimes used a combination of set_sec and set_nsec. Standardize
on a setNsec function that takes a number of nanoseconds and splits
them up to set the tv_sec and tv_nsec fields. Consistently mark
setNsec as go:nosplit, since it has to be that way on some systems
including Darwin and GNU/Linux. Consistently use timediv on 32-bit
systems to help stay within split-stack limits on processors that
don't have a 64-bit division instruction.

Change-Id: I6396bb7ddbef171a96876bdeaf7a1c585a6d725b
Reviewed-on: https://go-review.googlesource.com/c/go/+/167389
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
34 files changed:
src/runtime/defs1_netbsd_386.go
src/runtime/defs1_netbsd_amd64.go
src/runtime/defs1_netbsd_arm.go
src/runtime/defs1_solaris_amd64.go
src/runtime/defs_aix_ppc64.go
src/runtime/defs_darwin_386.go
src/runtime/defs_darwin_amd64.go
src/runtime/defs_darwin_arm.go
src/runtime/defs_darwin_arm64.go
src/runtime/defs_dragonfly_amd64.go
src/runtime/defs_freebsd_386.go
src/runtime/defs_freebsd_amd64.go
src/runtime/defs_freebsd_arm.go
src/runtime/defs_linux_386.go
src/runtime/defs_linux_amd64.go
src/runtime/defs_linux_arm.go
src/runtime/defs_linux_arm64.go
src/runtime/defs_linux_mips64x.go
src/runtime/defs_linux_mipsx.go
src/runtime/defs_linux_ppc64.go
src/runtime/defs_linux_ppc64le.go
src/runtime/defs_linux_s390x.go
src/runtime/defs_nacl_386.go
src/runtime/defs_nacl_amd64p32.go
src/runtime/defs_nacl_arm.go
src/runtime/defs_openbsd_386.go
src/runtime/defs_openbsd_amd64.go
src/runtime/defs_openbsd_arm.go
src/runtime/os_darwin.go
src/runtime/os_freebsd.go
src/runtime/os_linux.go
src/runtime/os_netbsd.go
src/runtime/os_openbsd.go
src/runtime/runtime1.go