1
0
mirror of https://github.com/golang/go synced 2024-11-22 15:24:42 -07:00

bytes: don't leave mprotect-ed pages after unsafe test.

Fixes inscrutable GC faults during testing.

R=golang-dev, bradfitz, dave, fullung
CC=golang-dev
https://golang.org/cl/8300044
This commit is contained in:
Rémy Oudompheng 2013-04-03 08:30:20 -07:00 committed by Brad Fitzpatrick
parent 2ba6ecb3e2
commit e42584effe

View File

@ -30,6 +30,8 @@ func TestEqualNearPageBoundary(t *testing.T) {
}
syscall.Mprotect(b[i-pagesize:i], 0)
syscall.Mprotect(b[i+pagesize:i+2*pagesize], 0)
defer syscall.Mprotect(b[i-pagesize:i], syscall.PROT_READ|syscall.PROT_WRITE)
defer syscall.Mprotect(b[i+pagesize:i+2*pagesize], syscall.PROT_READ|syscall.PROT_WRITE)
// both of these should fault
//pagesize += int(b[i-1])