Keyboard Shortcuts

File
u :up to issue
m :publish + mail comments
M :edit review message
j / k :jump to file after / before current file
J / K :jump to next file with a comment after / before current file
Side-by-side diff
i :toggle intra-line diffs
e :expand all comments
c :collapse all comments
s :toggle showing all comments
n / p :next / previous diff chunk or comment
N / P :next / previous comment
<Up> / <Down> :next / previous line
<Enter> :respond to / edit current comment
d :mark current comment as done
Issue
u :up to list of issues
m :publish + mail comments
j / k :jump to patch after / before current patch
o / <Enter> :open current patch in side-by-side view
i :open current patch in unified diff view
Issue List
j / k :jump to issue after / before current issue
o / <Enter> :open current issue
# : close issue
Comment/message editing
<Ctrl> + s or <Ctrl> + Enter :save comment
<Esc> :cancel edit
Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(524)
Issues Repositories Search
Open Issues | Closed Issues | All Issues | Sign in with your Google Account to create issues and add comments

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

Issue 2273041: code review 2273041: Initial Plan9 runtime support for 386. (Closed)
Left Patch Set: code review 2273041: Initial Plan9 runtime support for 386 [update to release.2010年09月29日]. Created 15 years, 1 month ago
Right Patch Set: code review 2273041: Initial Plan9 runtime support for 386. Created 15 years, 1 month 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/plan9/386/sys.s ('k') | src/pkg/runtime/plan9/os.h » ('j') | no next file with change/comment »
('i') | ('e') | ('c') | ('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 "malloc.h" 6 #include "malloc.h"
7 7
8 extern int8 end[]; 8 extern byte end[];
9 static int8 *bloc = { end }; 9 static byte *bloc = { end };
10 10
11 enum 11 enum
12 { 12 {
13 Round = 7 13 Round = 7
14 }; 14 };
15 15
16 void* 16 void*
17 SysAlloc(uintptr ask) 17 SysAlloc(uintptr ask)
18 { 18 {
19 uintptr bl; 19 » uintptr bl;
20 20 »
21 // Plan 9 sbrk from /sys/src/libc/9sys/sbrk.c 21 » // Plan 9 sbrk from /sys/src/libc/9sys/sbrk.c
22 bl = ((uintptr)bloc + Round) & ~Round; 22 » bl = ((uintptr)bloc + Round) & ~Round;
23 if(brk_((void*)(bl + ask)) < 0) 23 » if(brk_((void*)(bl + ask)) < 0)
24 return (void*)-1; 24 » » return (void*)-1;
25 bloc = (int8*)bl + ask; 25 » bloc = (byte*)bl + ask;
26 return (void*)bl; 26 » return (void*)bl;
27 } 27 }
28 28
29 void 29 void
30 SysFree(void *v, uintptr n) 30 SysFree(void *v, uintptr n)
31 { 31 {
32 // from tiny/mem.c 32 // from tiny/mem.c
33 // Push pointer back if this is a free 33 // Push pointer back if this is a free
34 // of the most recent SysAlloc. 34 // of the most recent SysAlloc.
35 n += (n + Round) & ~Round; 35 n += (n + Round) & ~Round;
36 » if(bloc == (int8*)v+n) 36 » if(bloc == (byte*)v+n)
37 bloc -= n;······ 37 bloc -= n;······
38 } 38 }
39 39
40 void 40 void
41 SysUnused(void *v, uintptr n) 41 SysUnused(void *v, uintptr n)
42 { 42 {
43 USED(v, n); 43 USED(v, n);
44 } 44 }
45 45
46 void 46 void
47 SysMemInit(void) 47 SysMemInit(void)
48 { 48 {
49 } 49 }
LEFTRIGHT
« src/pkg/runtime/plan9/386/sys.s ('k') | src/pkg/runtime/plan9/os.h » ('j') | ('i') | ('e') | ('c') | ('s')
Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b

AltStyle によって変換されたページ (->オリジナル) /