]> Cypherpunks repositories - gostls13.git/commit
runtime: make MemStats.LastGC Unix time again
authorDmitriy Vyukov <dvyukov@google.com>
Fri, 2 May 2014 16:32:42 +0000 (17:32 +0100)
committerDmitriy Vyukov <dvyukov@google.com>
Fri, 2 May 2014 16:32:42 +0000 (17:32 +0100)
commit350a8fcde14e936a4af33560b5365b18e822477a
treeca5f19962440c223f5934456848992bfb1a042ac
parent3879f0abcd94598723d6c3024e5006b52b736b7b
runtime: make MemStats.LastGC Unix time again
The monotonic clock patch changed all runtime times
to abstract monotonic time. As the result user-visible
MemStats.LastGC become monotonic time as well.
Restore Unix time for LastGC.

This is the simplest way to expose time.now to runtime that I found.
Another option would be to change time.now to C called
int64 runtime.unixnanotime() and then express time.now in terms of it.
But this would require to introduce 2 64-bit divisions into time.now.
Another option would be to change time.now to C called
void runtime.unixnanotime1(struct {int64 sec, int32 nsec} *now)
and then express both time.now and runtime.unixnanotime in terms of it.

Fixes #7852.

LGTM=minux.ma, iant
R=minux.ma, rsc, iant
CC=golang-codereviews
https://golang.org/cl/93720045
src/pkg/runtime/asm_386.s
src/pkg/runtime/asm_amd64.s
src/pkg/runtime/asm_amd64p32.s
src/pkg/runtime/asm_arm.s
src/pkg/runtime/gc_test.go
src/pkg/runtime/mgc0.c
src/pkg/runtime/mgc0.go