]> Cypherpunks repositories - gostls13.git/commit
runtime: make faketime more robust against GC
authorIan Lance Taylor <iant@golang.org>
Wed, 17 Nov 2021 19:07:44 +0000 (11:07 -0800)
committerIan Lance Taylor <iant@golang.org>
Wed, 17 Nov 2021 21:26:25 +0000 (21:26 +0000)
commit0440fb833405a5c61ed0269af9c5897b03390bac
tree8dfe9861e40ba6ad4e206e01df17c8c89095038a
parenta218365faeed6d62d3becabf0c8700f0e0b3a734
runtime: make faketime more robust against GC

When using faketime, only run the scavenger for one loop.
It tries to run for 1 ms, but with faketime that calculation fails.

Prohibit write barriers in the faketime write function, in case
the GC wants to print something (e.g., with GODEBUG=gctrace=1).

Fixes #49614

Change-Id: Iab5097fe78b6e0032ea8b493088264dfb25013c6
Reviewed-on: https://go-review.googlesource.com/c/go/+/364757
Trust: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
src/runtime/mgcscavenge.go
src/runtime/time_fake.go