Skip to content

Commit

Permalink
more explanations of
Browse files Browse the repository at this point in the history
  • Loading branch information
ldemailly committed Jul 18, 2024
1 parent 867aa5c commit 44cf645
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 2 additions & 0 deletions goroutine/gid_tinygo.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,7 @@ func ID() int64 {
//return int64(uintptr(currentTask()))
}

// Call https://github.com/tinygo-org/tinygo/blob/v0.32.0/src/internal/task/task_stack.go#L39
//
//go:linkname currentTask internal/task.Current
func currentTask() unsafe.Pointer
8 changes: 6 additions & 2 deletions logger_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -944,8 +944,12 @@ func TestInvalidFile(t *testing.T) {
}
}

// like io.Discard except io.Discard is checked for by logger optimizations and we want to avoid that.
// e.g. https://cs.opensource.google/go/go/+/refs/tags/go1.22.5:src/log/log.go;l=84
// --- Benchmarks

// This `discard` is like io.Discard, except that io.Discard is checked explicitly
// (e.g. https://cs.opensource.google/go/go/+/refs/tags/go1.22.5:src/log/log.go;l=84)
// in logger optimizations and we want to measure the actual production
// of messages.
type discard struct{}

func (discard) Write(p []byte) (int, error) {
Expand Down

0 comments on commit 44cf645

Please sign in to comment.