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

Side by Side Diff: src/pkg/runtime/string.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/stack_test.go ('k') | src/pkg/runtime/string.go » ('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 2009 The Go Authors. All rights reserved. 1 // Copyright 2009 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 "malloc.h" 7 #include "malloc.h"
8 #include "race.h" 8 #include "race.h"
9 #include "../../cmd/ld/textflag.h" 9 #include "textflag.h"
10 10
11 String runtime·emptystring; 11 String runtime·emptystring;
12 12
13 #pragma textflag NOSPLIT 13 #pragma textflag NOSPLIT
14 intgo 14 intgo
15 runtime·findnull(byte *s) 15 runtime·findnull(byte *s)
16 { 16 {
17 intgo l; 17 intgo l;
18 18
19 if(s == nil) 19 if(s == nil)
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 { 83 {
84 Slice sl; 84 Slice sl;
85 85
86 sl.array = runtime·mallocgc(n, 0, FlagNoScan|FlagNoZero); 86 sl.array = runtime·mallocgc(n, 0, FlagNoScan|FlagNoZero);
87 sl.len = n; 87 sl.len = n;
88 sl.cap = n; 88 sl.cap = n;
89 runtime·memmove(sl.array, p, n); 89 runtime·memmove(sl.array, p, n);
90 return sl; 90 return sl;
91 } 91 }
92 92
93 #pragma textflag NOSPLIT
93 String 94 String
94 runtime·gostringnocopy(byte *str) 95 runtime·gostringnocopy(byte *str)
95 { 96 {
96 String s; 97 String s;
97 ········ 98 ········
98 s.str = str; 99 s.str = str;
99 s.len = runtime·findnull(str); 100 s.len = runtime·findnull(str);
100 return s; 101 return s;
101 } 102 }
102 103
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after
278 sp2 = s2; 279 sp2 = s2;
279 for(;;) { 280 for(;;) {
280 if(*sp2 == 0) 281 if(*sp2 == 0)
281 return s1; 282 return s1;
282 if(*sp1++ != *sp2++) 283 if(*sp1++ != *sp2++)
283 break; 284 break;
284 } 285 }
285 } 286 }
286 return nil; 287 return nil;
287 } 288 }
OLDNEW
« no previous file with comments | « src/pkg/runtime/stack_test.go ('k') | src/pkg/runtime/string.go » ('j') | no next file with comments »

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