diff options
| author | qiulaidongfeng <2645477756@qq.com> | 2023-10-10 12:43:40 +0000 |
|---|---|---|
| committer | Keith Randall <khr@golang.org> | 2023-10-24 20:28:25 +0000 |
| commit | b5f87b5407916c4049a3158cc944cebfd7a883a9 (patch) | |
| tree | 64b4a4c47ee017cad96b8b908ba368ee966ecdf1 /src/runtime/mfixalloc.go | |
| parent | 9ab5121691ee0c4f32bf8d8c3c10c0e85a89ceb5 (diff) | |
| download | go-b5f87b5407916c4049a3158cc944cebfd7a883a9.tar.xz | |
runtime: use max/min func
Change-Id: I3f0b7209621b39cee69566a5cc95e4343b4f1f20
GitHub-Last-Rev: af9dbbe69ad74e8c210254dafa260a886b690853
GitHub-Pull-Request: golang/go#63321
Reviewed-on: https://go-review.googlesource.com/c/go/+/531916
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Keith Randall <khr@google.com>
Reviewed-by: Mauri de Souza Meneguzzo <mauri870@gmail.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Keith Randall <khr@golang.org>
Diffstat (limited to 'src/runtime/mfixalloc.go')
| -rw-r--r-- | src/runtime/mfixalloc.go | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/src/runtime/mfixalloc.go b/src/runtime/mfixalloc.go index 1a249e5981..7760ada397 100644 --- a/src/runtime/mfixalloc.go +++ b/src/runtime/mfixalloc.go @@ -57,9 +57,7 @@ func (f *fixalloc) init(size uintptr, first func(arg, p unsafe.Pointer), arg uns if size > _FixAllocChunk { throw("runtime: fixalloc size too large") } - if min := unsafe.Sizeof(mlink{}); size < min { - size = min - } + size = max(size, unsafe.Sizeof(mlink{})) f.size = size f.first = first |
