diff options
| author | Martin Möhrmann <moehrmann@google.com> | 2018-01-27 11:55:34 +0100 |
|---|---|---|
| committer | Martin Möhrmann <moehrmann@google.com> | 2018-10-15 17:58:06 +0000 |
| commit | c9130cae9a9cd59178e842851f3f30b1d97ab0bd (patch) | |
| tree | 1c39f76c8b36dc646d7de76300065663daf67c86 /src/runtime/string.go | |
| parent | 240a30da1b3f5d4d60640a09f135275e8fee8b92 (diff) | |
| download | go-c9130cae9a9cd59178e842851f3f30b1d97ab0bd.tar.xz | |
runtime/internal/math: add multiplication with overflow check
This CL adds a new internal math package for use by the runtime.
The new package exports a MulUintptr function with uintptr arguments
a and b and returns uintptr(a*b) and whether the full-width product
x*y does overflow the uintptr value range (uintptr(x*y) != x*y).
Uses of MulUinptr in the runtime and intrinsics for performance
will be added in followup CLs.
Updates #21588
Change-Id: Ia5a02eeabc955249118e4edf68c67d9fc0858058
Reviewed-on: https://go-review.googlesource.com/c/91755
Run-TryBot: Martin Möhrmann <moehrmann@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
Diffstat (limited to 'src/runtime/string.go')
0 files changed, 0 insertions, 0 deletions
