]> Cypherpunks repositories - gostls13.git/commitdiff
runtime: correct ptrSize test in Linux version of sysReserve
authorIan Lance Taylor <iant@golang.org>
Sun, 14 Dec 2014 15:59:11 +0000 (07:59 -0800)
committerIan Lance Taylor <iant@golang.org>
Tue, 23 Dec 2014 02:18:29 +0000 (02:18 +0000)
Change-Id: I90a8ca51269528a307e0d6f52436fc7913cd7900
Reviewed-on: https://go-review.googlesource.com/1541
Reviewed-by: Russ Cox <rsc@golang.org>
src/runtime/mem_linux.go

index 85b55ef49ae48a64967679c06a7ffc0eaa8a05f1..0cb4b78f6be766b471d42fb9fec5dfa97ce455ed 100644 (file)
@@ -88,7 +88,7 @@ func sysReserve(v unsafe.Pointer, n uintptr, reserved *bool) unsafe.Pointer {
        // much address space.  Instead, assume that the reservation is okay
        // if we can reserve at least 64K and check the assumption in SysMap.
        // Only user-mode Linux (UML) rejects these requests.
-       if ptrSize == 7 && uint64(n) > 1<<32 {
+       if ptrSize == 8 && uint64(n) > 1<<32 {
                p := mmap_fixed(v, 64<<10, _PROT_NONE, _MAP_ANON|_MAP_PRIVATE, -1, 0)
                if p != v {
                        if uintptr(p) >= 4096 {