aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/stubs.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/runtime/stubs.go')
-rw-r--r--src/runtime/stubs.go7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/runtime/stubs.go b/src/runtime/stubs.go
index 26aaf2224d..8d1c698400 100644
--- a/src/runtime/stubs.go
+++ b/src/runtime/stubs.go
@@ -295,6 +295,13 @@ func round(n, a uintptr) uintptr {
return (n + a - 1) &^ (a - 1)
}
+// divRoundUp returns ceil(n / a).
+func divRoundUp(n, a uintptr) uintptr {
+ // a is generally a power of two. This will get inlined and
+ // the compiler will optimize the division.
+ return (n + a - 1) / a
+}
+
// checkASM reports whether assembly runtime checks have passed.
func checkASM() bool