mmap: fix max size of bytes.

data should have more large size.

Fixes golang/go#26028

Change-Id: I41251ad3be8588b19dd46b7380373f9e52b884be
Reviewed-on: https://go-review.googlesource.com/120657
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
diff --git a/mmap/mmap_windows.go b/mmap/mmap_windows.go
index 4d1bc3d..a2f1158 100644
--- a/mmap/mmap_windows.go
+++ b/mmap/mmap_windows.go
@@ -108,7 +108,7 @@
 	if err != nil {
 		return nil, err
 	}
-	data := (*[1 << 30]byte)(unsafe.Pointer(ptr))[:size]
+	data := (*[maxBytes]byte)(unsafe.Pointer(ptr))[:size]
 
 	r := &ReaderAt{data: data}
 	if debug {
diff --git a/mmap/mmap_windows_386.go b/mmap/mmap_windows_386.go
new file mode 100644
index 0000000..26e8b7a
--- /dev/null
+++ b/mmap/mmap_windows_386.go
@@ -0,0 +1,7 @@
+// Copyright 2018 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package mmap
+
+const maxBytes = 1<<31 - 1
diff --git a/mmap/mmap_windows_amd64.go b/mmap/mmap_windows_amd64.go
new file mode 100644
index 0000000..656bedd
--- /dev/null
+++ b/mmap/mmap_windows_amd64.go
@@ -0,0 +1,7 @@
+// Copyright 2018 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package mmap
+
+const maxBytes = 1<<50 - 1