OLD | NEW |
1 // Copyright 2010 The Go Authors. All rights reserved. | 1 // Copyright 2010 The Go Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style | 2 // Use of this source code is governed by a BSD-style |
3 // license that can be found in the LICENSE file. | 3 // license that can be found in the LICENSE file. |
4 | 4 |
5 #include "runtime.h" | 5 #include "runtime.h" |
6 #include "arch.h" | 6 #include "arch_GOARCH.h" |
7 #include "os.h" | 7 #include "os_GOOS.h" |
8 #include "defs.h" | 8 #include "defs_GOOS_GOARCH.h" |
9 #include "malloc.h" | 9 #include "malloc.h" |
10 | 10 |
11 enum { | 11 enum { |
12 MEM_COMMIT = 0x1000, | 12 MEM_COMMIT = 0x1000, |
13 MEM_RESERVE = 0x2000, | 13 MEM_RESERVE = 0x2000, |
14 MEM_RELEASE = 0x8000, | 14 MEM_RELEASE = 0x8000, |
15 ········ | 15 ········ |
16 PAGE_EXECUTE_READWRITE = 0x40, | 16 PAGE_EXECUTE_READWRITE = 0x40, |
17 }; | 17 }; |
18 | 18 |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
62 void | 62 void |
63 runtime·SysMap(void *v, uintptr n) | 63 runtime·SysMap(void *v, uintptr n) |
64 { | 64 { |
65 void *p; | 65 void *p; |
66 ········ | 66 ········ |
67 mstats.sys += n; | 67 mstats.sys += n; |
68 p = runtime·stdcall(runtime·VirtualAlloc, 4, v, n, (uintptr)MEM_COMMIT,
(uintptr)PAGE_EXECUTE_READWRITE); | 68 p = runtime·stdcall(runtime·VirtualAlloc, 4, v, n, (uintptr)MEM_COMMIT,
(uintptr)PAGE_EXECUTE_READWRITE); |
69 if(p != v) | 69 if(p != v) |
70 runtime·throw("runtime: cannot map pages in arena address space"
); | 70 runtime·throw("runtime: cannot map pages in arena address space"
); |
71 } | 71 } |
OLD | NEW |