From b39e15dde5ec7b96c15da9faf4ab5892501c1aae Mon Sep 17 00:00:00 2001 From: Michael Stapelberg Date: Sat, 23 Mar 2013 11:28:53 +0100 Subject: Imported Upstream version 1.1~hg20130323 --- src/pkg/runtime/mem_openbsd.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'src/pkg/runtime/mem_openbsd.c') diff --git a/src/pkg/runtime/mem_openbsd.c b/src/pkg/runtime/mem_openbsd.c index 77ce04c4e..e5bdac0ef 100644 --- a/src/pkg/runtime/mem_openbsd.c +++ b/src/pkg/runtime/mem_openbsd.c @@ -50,10 +50,9 @@ runtime·SysReserve(void *v, uintptr n) return v; p = runtime·mmap(v, n, PROT_NONE, MAP_ANON|MAP_PRIVATE, -1, 0); - if (p == ((void *)-ENOMEM)) + if(p < (void*)4096) return nil; - else - return p; + return p; } void @@ -66,7 +65,7 @@ runtime·SysMap(void *v, uintptr n) // On 64-bit, we don't actually have v reserved, so tread carefully. if(sizeof(void*) == 8) { p = runtime·mmap(v, n, PROT_READ|PROT_WRITE, MAP_ANON|MAP_PRIVATE, -1, 0); - if(p == (void*)-ENOMEM) + if(p == (void*)ENOMEM) runtime·throw("runtime: out of memory"); if(p != v) { runtime·printf("runtime: address space conflict: map(%p) = %p\n", v, p); @@ -76,7 +75,7 @@ runtime·SysMap(void *v, uintptr n) } p = runtime·mmap(v, n, PROT_READ|PROT_WRITE, MAP_ANON|MAP_FIXED|MAP_PRIVATE, -1, 0); - if(p == (void*)-ENOMEM) + if(p == (void*)ENOMEM) runtime·throw("runtime: out of memory"); if(p != v) runtime·throw("runtime: cannot map pages in arena address space"); -- cgit v1.2.3