]> Cypherpunks repositories - gostls13.git/commitdiff
runtime: remove unused memlimit function
authorAustin Clements <austin@google.com>
Mon, 29 Jan 2018 17:22:32 +0000 (12:22 -0500)
committerAustin Clements <austin@google.com>
Tue, 13 Feb 2018 22:35:47 +0000 (22:35 +0000)
Change-Id: Id057dcc85d64e5c670710fbab6cacd4b906cf594
Reviewed-on: https://go-review.googlesource.com/93655
Run-TryBot: Austin Clements <austin@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
src/runtime/os3_solaris.go
src/runtime/os_darwin.go
src/runtime/os_dragonfly.go
src/runtime/os_freebsd.go
src/runtime/os_linux.go
src/runtime/os_nacl.go
src/runtime/os_netbsd.go
src/runtime/os_openbsd.go
src/runtime/os_plan9.go
src/runtime/os_windows.go

index c53f6132ee613fd74422430806e0579cb09491e7..226cdd1188aab7af291e0ff18879211abb1761ec 100644 (file)
@@ -223,37 +223,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
-}
-
 func sigtramp()
 
 //go:nosplit
index 580dffa1a399d9efa397f3a7c3b73a58ad2742f3..63351f504d38e824d4afab88f104a0903ad33799 100644 (file)
@@ -483,14 +483,6 @@ func osyield() {
        usleep(1)
 }
 
-func memlimit() uintptr {
-       // NOTE(rsc): Could use getrlimit here,
-       // like on FreeBSD or Linux, but Darwin doesn't enforce
-       // ulimit -v, so it's unclear why we'd try to stay within
-       // the limit.
-       return 0
-}
-
 const (
        _NSIG        = 32
        _SI_USER     = 0 /* empirically true, but not what headers say */
index 4e506796de9c9e8abfe80b3f5464f54b52fe1896..4c3ce28074b25b6558e437fa24956b1310aabd23 100644 (file)
@@ -193,37 +193,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
-}
-
 func sigtramp()
 
 type sigactiont struct {
index 31708e2454b111170e0b61cbb6b20804ddc0ca7e..855bf30b6f91fbb8b3cb5ca81b419b25cddd26bf 100644 (file)
@@ -266,37 +266,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
-}
-
 func sigtramp()
 
 type sigactiont struct {
index 98e7f52b9e63e66c50805913d48880a784ffad2f..2e442192cc818f467967db5bf7f05680eb8f2e1b 100644 (file)
@@ -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
index 6830da4c4f47ddb234f305fb48994faaee0b633e..d03cb8faf2fdc7c8e64e072f16476639648fd57d 100644 (file)
@@ -246,10 +246,6 @@ func semawakeup(mp *m) {
        })
 }
 
-func memlimit() uintptr {
-       return 0
-}
-
 // This runs on a foreign stack, without an m or a g. No stack split.
 //go:nosplit
 //go:norace
index 377896931814ace376ff82e714421085e2001c3d..abd6512dc3a7cc3aa62b0fcaaea4cd9c42395368 100644 (file)
@@ -272,10 +272,6 @@ func unminit() {
        unminitSignals()
 }
 
-func memlimit() uintptr {
-       return 0
-}
-
 func sigtramp()
 
 type sigactiont struct {
index 350166d101ce157384ee95a92de05c7896443015..c3c04b8b50a6d856fa74cf49ccdde6595e967993 100644 (file)
@@ -226,10 +226,6 @@ func unminit() {
        unminitSignals()
 }
 
-func memlimit() uintptr {
-       return 0
-}
-
 func sigtramp()
 
 type sigactiont struct {
index 32fdabb29f473e547dadb65a47170e726ca743ae..38f0cf5a2b7653b690e8bdbd8205c7789dd8e66f 100644 (file)
@@ -466,10 +466,6 @@ func write(fd uintptr, buf unsafe.Pointer, n int32) int64 {
        return int64(pwrite(int32(fd), buf, n, -1))
 }
 
-func memlimit() uint64 {
-       return 0
-}
-
 var _badsignal = []byte("runtime: signal received on thread not created by Go.\n")
 
 // This runs on a foreign stack, without an m or a g. No stack split.
index 7aeadd9ef1252f597c41ce5a5dcba88a44138178..d27bf7445591862458198a7fa1b4d893e81e21e7 100644 (file)
@@ -885,7 +885,3 @@ func setThreadCPUProfiler(hz int32) {
        stdcall6(_SetWaitableTimer, profiletimer, uintptr(unsafe.Pointer(&due)), uintptr(ms), 0, 0, 0)
        atomic.Store((*uint32)(unsafe.Pointer(&getg().m.profilehz)), uint32(hz))
 }
-
-func memlimit() uintptr {
-       return 0
-}