]> Cypherpunks repositories - gostls13.git/commit
runtime: implement runtime.SysUnused on FreeBSD
authorJohn Graham-Cumming <jgc@jgc.org>
Sat, 24 Nov 2012 04:55:19 +0000 (15:55 +1100)
committerDave Cheney <dave@cheney.net>
Sat, 24 Nov 2012 04:55:19 +0000 (15:55 +1100)
commit314fd624343eaa2d110f9b5b192a0a8f354d63ed
tree4b8673d0d4f4790c78c5907d1f716d12d4d0a4de
parentd4775a7814317b20aedab0d79c7892c89a93a622
runtime: implement runtime.SysUnused on FreeBSD

madvise was missing so implement it in assembler. This change
needs to be extended to the other BSD variantes (Net and Open)

Without this change the scavenger will attempt to pass memory back
to the operating system when it has become idle, but the memory is
not returned and for long running Go processes the total memory used
can grow until OOM occurs.

I have only been able to test the code on FreeBSD AMD64. The ARM
platforms needs testing.

R=golang-dev, mikioh.mikioh, dave, jgc, minux.ma
CC=golang-dev
https://golang.org/cl/6850081
src/pkg/runtime/defs_freebsd.go
src/pkg/runtime/defs_freebsd_386.h
src/pkg/runtime/defs_freebsd_amd64.h
src/pkg/runtime/defs_freebsd_arm.h
src/pkg/runtime/mem_freebsd.c
src/pkg/runtime/sys_freebsd_386.s
src/pkg/runtime/sys_freebsd_amd64.s
src/pkg/runtime/sys_freebsd_arm.s