]> Cypherpunks.ru repositories - gostls13.git/commit
runtime: add byte count parser for GOMEMLIMIT
authorMichael Anthony Knyszek <mknyszek@google.com>
Tue, 15 Feb 2022 00:22:20 +0000 (00:22 +0000)
committerMichael Knyszek <mknyszek@google.com>
Tue, 3 May 2022 15:11:55 +0000 (15:11 +0000)
commit0feebe6eb594e28c29022c65ffcd2ae0e8bebac7
tree38dbfd31814883226905f5abdcd238047e51c34a
parent01359b46815e63307077dfa03972f40d2e0d94fe
runtime: add byte count parser for GOMEMLIMIT

This change adds a parser for the GOMEMLIMIT environment variable's
input. This environment variable accepts a number followed by an
optional prefix expressing the unit. Acceptable units include
B, KiB, MiB, GiB, TiB, where *iB is a power-of-two byte unit.

For #48409.

Change-Id: I6a3b4c02b175bfcf9c4debee6118cf5dda93bb6f
Reviewed-on: https://go-review.googlesource.com/c/go/+/393400
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Michael Pratt <mpratt@google.com>
Run-TryBot: Michael Knyszek <mknyszek@google.com>
src/runtime/export_test.go
src/runtime/string.go
src/runtime/string_test.go