From 6dbaa206fbe7345fac181ec3d91a4157d5532fbd Mon Sep 17 00:00:00 2001 From: Russ Cox Date: Tue, 29 May 2012 14:02:29 -0400 Subject: runtime: replace runtime·rnd function with ROUND macro MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It's sad to introduce a new macro, but rnd shows up consistently in profiles, and the function call overwhelms the two arithmetic instructions it performs. R=r CC=golang-dev https://golang.org/cl/6260051 --- src/pkg/runtime/runtime.c | 13 ------------- 1 file changed, 13 deletions(-) (limited to 'src/pkg/runtime/runtime.c') diff --git a/src/pkg/runtime/runtime.c b/src/pkg/runtime/runtime.c index 2cb3501dd1..cca061be79 100644 --- a/src/pkg/runtime/runtime.c +++ b/src/pkg/runtime/runtime.c @@ -156,19 +156,6 @@ runtime·mchr(byte *p, byte c, byte *ep) return nil; } -uint32 -runtime·rnd(uint32 n, uint32 m) -{ - uint32 r; - - if(m > maxround) - m = maxround; - r = n % m; - if(r) - n += m-r; - return n; -} - static int32 argc; static uint8** argv; -- cgit v1.3