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 "defs.h" | 7 #include "defs_GOOS_GOARCH.h" |
8 #include "os.h" | 8 #include "os_GOOS.h" |
9 #include "malloc.h" | 9 #include "malloc.h" |
10 | 10 |
11 enum | 11 enum |
12 { | 12 { |
13 ENOMEM = 12, | 13 ENOMEM = 12, |
14 }; | 14 }; |
15 | 15 |
16 void* | 16 void* |
17 runtime·SysAlloc(uintptr n) | 17 runtime·SysAlloc(uintptr n) |
18 { | 18 { |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
76 } | 76 } |
77 return; | 77 return; |
78 } | 78 } |
79 | 79 |
80 p = runtime·mmap(v, n, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_ANON|MAP_FIXE
D|MAP_PRIVATE, -1, 0); | 80 p = runtime·mmap(v, n, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_ANON|MAP_FIXE
D|MAP_PRIVATE, -1, 0); |
81 if(p == (void*)-ENOMEM) | 81 if(p == (void*)-ENOMEM) |
82 runtime·throw("runtime: out of memory"); | 82 runtime·throw("runtime: out of memory"); |
83 if(p != v) | 83 if(p != v) |
84 runtime·throw("runtime: cannot map pages in arena address space"
); | 84 runtime·throw("runtime: cannot map pages in arena address space"
); |
85 } | 85 } |
OLD | NEW |