diff options
| author | Dmitry Vyukov <dvyukov@google.com> | 2016-11-07 14:45:15 -0800 |
|---|---|---|
| committer | Dmitry Vyukov <dvyukov@google.com> | 2016-11-11 14:34:41 -0800 |
| commit | 3a65453870b12f5c42739c27d99df8fc58358f88 (patch) | |
| tree | f0ca6508ab6f3b6ea78e6260c28dd09f37c9d48c /prog/prio.go | |
| parent | 588a542b2a23ba477031bf20b4c46b0f40a04b7d (diff) | |
sys: allow to specify buffer size for strings
This allows to write:
string[salg_type, 14]
which will give a string buffer of size 14 regardless of actual string size.
Convert salg_type/salg_name to this.
Diffstat (limited to 'prog/prio.go')
| -rw-r--r-- | prog/prio.go | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/prog/prio.go b/prog/prio.go index a6919372d..59a205a5d 100644 --- a/prog/prio.go +++ b/prog/prio.go @@ -80,9 +80,11 @@ func calcStaticPriorities() [][]float32 { } case *sys.BufferType: switch a.Kind { - case sys.BufferBlobRand, sys.BufferBlobRange, sys.BufferAlgType, sys.BufferAlgName: + case sys.BufferBlobRand, sys.BufferBlobRange: case sys.BufferString: - noteUsage(0.2, "str") + if a.SubKind != "" { + noteUsage(0.2, fmt.Sprintf("str-%v", a.SubKind)) + } case sys.BufferSockaddr: noteUsage(1.0, "sockaddr") case sys.BufferFilename: |
