]> Cypherpunks repositories - gostls13.git/commit
runtime: don't use twice the memory with grsec-like kernels
authorGustavo Niemeyer <gustavo@niemeyer.net>
Fri, 24 Jun 2011 03:29:59 +0000 (00:29 -0300)
committerGustavo Niemeyer <gustavo@niemeyer.net>
Fri, 24 Jun 2011 03:29:59 +0000 (00:29 -0300)
commit65b036c38107ef805edc7734b705157a8d9d43bd
tree78983475b9353411b4dd74d8d42bd99c9f70c146
parentb4bab6f8b351630211b0617ac91fb532d6aaf16d
runtime: don't use twice the memory with grsec-like kernels

grsec needs the FIXED flag to be provided to mmap, which
works now.  That said, when the allocation fails to be made
in the specific address, we're still given back a writable
page.  This change will unmap that page to avoid using
twice the amount of memory needed.

It'd also be pretty easy to avoid the extra system calls
once we detected that the flag is needed, but I'm not sure
if that edge case is worth the effort.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/4634086
src/pkg/runtime/linux/mem.c