]> Cypherpunks repositories - gostls13.git/commit
runtime: correct mmap return value checking on netbsd/openbsd
authorJoel Sing <jsing@google.com>
Mon, 18 Mar 2013 01:18:49 +0000 (12:18 +1100)
committerJoel Sing <jsing@google.com>
Mon, 18 Mar 2013 01:18:49 +0000 (12:18 +1100)
commit7f50c23e2d18c445bfe790692e998ff91b37ddc2
treebf00dc76f10aa4d6cf1853d2780c6cf7c1fe9920
parentb7b4783622b4e21e7fb515b614bc651fe6210d7c
runtime: correct mmap return value checking on netbsd/openbsd

The current SysAlloc implementation suffers from a signed vs unsigned
comparision bug. Since the error code from mmap is negated, the
unsigned comparision of v < 4096 is always false on error. Fix this
by switching to the darwin/freebsd/linux mmap model and leave the mmap
return value unmodified.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/7870044
src/pkg/runtime/mem_netbsd.c
src/pkg/runtime/mem_openbsd.c
src/pkg/runtime/sys_netbsd_386.s
src/pkg/runtime/sys_netbsd_amd64.s
src/pkg/runtime/sys_openbsd_386.s
src/pkg/runtime/sys_openbsd_amd64.s