Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(126)

Side by Side Diff: src/pkg/runtime/mem_freebsd.c

Issue 160200044: [dev.power64] code review 160200044: build: merge default into dev.power64 (Closed)
Patch Set: diff -r be0c14f62257b42485019e9e1db23cf40d2e249f https://code.google.com/p/go Created 10 years, 4 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/pkg/runtime/mem_dragonfly.c ('k') | src/pkg/runtime/mem_linux.c » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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_GOARCH.h" 6 #include "arch_GOARCH.h"
7 #include "defs_GOOS_GOARCH.h" 7 #include "defs_GOOS_GOARCH.h"
8 #include "os_GOOS.h" 8 #include "os_GOOS.h"
9 #include "malloc.h" 9 #include "malloc.h"
10 #include "textflag.h"
10 11
11 enum 12 enum
12 { 13 {
13 ENOMEM = 12, 14 ENOMEM = 12,
14 }; 15 };
15 16
17 #pragma textflag NOSPLIT
16 void* 18 void*
17 runtime·SysAlloc(uintptr n, uint64 *stat) 19 runtime·sysAlloc(uintptr n, uint64 *stat)
18 { 20 {
19 void *v; 21 void *v;
20 22
21 v = runtime·mmap(nil, n, PROT_READ|PROT_WRITE, MAP_ANON|MAP_PRIVATE, -1, 0); 23 v = runtime·mmap(nil, n, PROT_READ|PROT_WRITE, MAP_ANON|MAP_PRIVATE, -1, 0);
22 if(v < (void*)4096) 24 if(v < (void*)4096)
23 return nil; 25 return nil;
24 runtime·xadd64(stat, n); 26 runtime·xadd64(stat, n);
25 return v; 27 return v;
26 } 28 }
27 29
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
89 } 91 }
90 return; 92 return;
91 } 93 }
92 94
93 p = runtime·mmap(v, n, PROT_READ|PROT_WRITE, MAP_ANON|MAP_FIXED|MAP_PRIV ATE, -1, 0); 95 p = runtime·mmap(v, n, PROT_READ|PROT_WRITE, MAP_ANON|MAP_FIXED|MAP_PRIV ATE, -1, 0);
94 if(p == (void*)ENOMEM) 96 if(p == (void*)ENOMEM)
95 runtime·throw("runtime: out of memory"); 97 runtime·throw("runtime: out of memory");
96 if(p != v) 98 if(p != v)
97 runtime·throw("runtime: cannot map pages in arena address space" ); 99 runtime·throw("runtime: cannot map pages in arena address space" );
98 } 100 }
OLDNEW
« no previous file with comments | « src/pkg/runtime/mem_dragonfly.c ('k') | src/pkg/runtime/mem_linux.c » ('j') | no next file with comments »

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b