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

Delta Between Two Patch Sets: src/pkg/runtime/mem_freebsd.c

Issue 5490053: code review 5490053: runtime: make more build-friendly (Closed)
Left Patch Set: diff -r 4bd43e05039c https://go.googlecode.com/hg/ Created 13 years, 3 months ago
Right Patch Set: diff -r 046739c8299b https://go.googlecode.com/hg/ Created 13 years, 3 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:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « src/pkg/runtime/mem_darwin.c ('k') | src/pkg/runtime/mem_linux.c » ('j') | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
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 void* 11 void*
12 runtime·SysAlloc(uintptr n) 12 runtime·SysAlloc(uintptr n)
13 { 13 {
14 void *v; 14 void *v;
15 15
16 mstats.sys += n; 16 mstats.sys += n;
17 v = runtime·mmap(nil, n, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_ANON|MAP_PR IVATE, -1, 0); 17 v = runtime·mmap(nil, n, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_ANON|MAP_PR IVATE, -1, 0);
18 if(v < (void*)4096) 18 if(v < (void*)4096)
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 } 70 }
71 return; 71 return;
72 } 72 }
73 73
74 p = runtime·mmap(v, n, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_ANON|MAP_FIXE D|MAP_PRIVATE, -1, 0); 74 p = runtime·mmap(v, n, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_ANON|MAP_FIXE D|MAP_PRIVATE, -1, 0);
75 if(p == (void*)-ENOMEM) 75 if(p == (void*)-ENOMEM)
76 runtime·throw("runtime: out of memory"); 76 runtime·throw("runtime: out of memory");
77 if(p != v) 77 if(p != v)
78 runtime·throw("runtime: cannot map pages in arena address space" ); 78 runtime·throw("runtime: cannot map pages in arena address space" );
79 } 79 }
LEFTRIGHT

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