Commit 8693b4f0 authored by Austin Clements's avatar Austin Clements

runtime: remove unused memlimit function

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: 's avatarBrad Fitzpatrick <bradfitz@golang.org>
parent 618f88d8
......@@ -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
......
......@@ -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 */
......
......@@ -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 {
......
......@@ -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 {
......
......@@ -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
......
......@@ -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
......
......@@ -272,10 +272,6 @@ func unminit() {
unminitSignals()
}
func memlimit() uintptr {
return 0
}
func sigtramp()
type sigactiont struct {
......
......@@ -226,10 +226,6 @@ func unminit() {
unminitSignals()
}
func memlimit() uintptr {
return 0
}
func sigtramp()
type sigactiont struct {
......
......@@ -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.
......
......@@ -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
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment