From 8693b4f095b2efdbd11967655579606bc3192c59 Mon Sep 17 00:00:00 2001 From: Austin Clements Date: Mon, 29 Jan 2018 12:22:32 -0500 Subject: runtime: remove unused memlimit function Change-Id: Id057dcc85d64e5c670710fbab6cacd4b906cf594 Reviewed-on: https://go-review.googlesource.com/93655 Run-TryBot: Austin Clements TryBot-Result: Gobot Gobot Reviewed-by: Brad Fitzpatrick --- src/runtime/os_linux.go | 32 -------------------------------- 1 file changed, 32 deletions(-) (limited to 'src/runtime/os_linux.go') diff --git a/src/runtime/os_linux.go b/src/runtime/os_linux.go index 98e7f52b9e..2e442192cc 100644 --- a/src/runtime/os_linux.go +++ b/src/runtime/os_linux.go @@ -324,38 +324,6 @@ func unminit() { unminitSignals() } -func memlimit() uintptr { - /* - TODO: Convert to Go when something actually uses the result. - - Rlimit rl; - extern byte runtime·text[], runtime·end[]; - uintptr used; - - if(runtime·getrlimit(RLIMIT_AS, &rl) != 0) - return 0; - if(rl.rlim_cur >= 0x7fffffff) - return 0; - - // Estimate our VM footprint excluding the heap. - // Not an exact science: use size of binary plus - // some room for thread stacks. - used = runtime·end - runtime·text + (64<<20); - if(used >= rl.rlim_cur) - return 0; - - // If there's not at least 16 MB left, we're probably - // not going to be able to do much. Treat as no limit. - rl.rlim_cur -= used; - if(rl.rlim_cur < (16<<20)) - return 0; - - return rl.rlim_cur - used; - */ - - return 0 -} - //#ifdef GOARCH_386 //#define sa_handler k_sa_handler //#endif -- cgit v1.3-5-g9baa