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

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

Issue 10136043: code review 10136043: runtime: refactor mallocgc (Closed)
Left Patch Set: diff -r 4aa7943034c5 https://dvyukov%40google.com@code.google.com/p/go/ Created 11 years, 9 months ago
Right Patch Set: diff -r 654ca7de0282 https://dvyukov%40google.com@code.google.com/p/go/ Created 11 years, 8 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:
Right: Side by side diff | Download
« no previous file with change/comment | « src/pkg/runtime/proc.c ('k') | src/pkg/runtime/string.goc » ('j') | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
(no file at all)
1 // Copyright 2013 The Go Authors. All rights reserved. 1 // Copyright 2013 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 "stack.h" 8 #include "stack.h"
9 9
10 enum 10 enum
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 if(m->stackcachecnt == 0) 98 if(m->stackcachecnt == 0)
99 stackcacherefill(); 99 stackcacherefill();
100 pos = m->stackcachepos; 100 pos = m->stackcachepos;
101 pos = (pos - 1) % StackCacheSize; 101 pos = (pos - 1) % StackCacheSize;
102 v = m->stackcache[pos]; 102 v = m->stackcache[pos];
103 m->stackcachepos = pos; 103 m->stackcachepos = pos;
104 m->stackcachecnt--; 104 m->stackcachecnt--;
105 m->stackinuse++; 105 m->stackinuse++;
106 return v; 106 return v;
107 } 107 }
108 » return runtime·mallocgc(n, FlagNoProfiling|FlagNoGC, 0, 0); 108 » return runtime·mallocgc(n, 0, FlagNoProfiling|FlagNoGC|FlagNoZero|FlagNo InvokeGC);
109 } 109 }
110 110
111 void 111 void
112 runtime·stackfree(void *v, uintptr n) 112 runtime·stackfree(void *v, uintptr n)
113 { 113 {
114 uint32 pos; 114 uint32 pos;
115 115
116 if(n == FixedStack || m->mallocing || m->gcing) { 116 if(n == FixedStack || m->mallocing || m->gcing) {
117 if(m->stackcachecnt == StackCacheSize) 117 if(m->stackcachecnt == StackCacheSize)
118 stackcacherelease(); 118 stackcacherelease();
(...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after
337 *(int32*)345 = 123; // never return 337 *(int32*)345 = 123; // never return
338 } 338 }
339 339
340 // adjust Gobuf as if it executed a call to fn 340 // adjust Gobuf as if it executed a call to fn
341 // and then did an immediate gosave. 341 // and then did an immediate gosave.
342 void 342 void
343 runtime·gostartcallfn(Gobuf *gobuf, FuncVal *fv) 343 runtime·gostartcallfn(Gobuf *gobuf, FuncVal *fv)
344 { 344 {
345 runtime·gostartcall(gobuf, fv->fn, fv); 345 runtime·gostartcall(gobuf, fv->fn, fv);
346 } 346 }
LEFTRIGHT

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