LEFT | RIGHT |
(no file at all) | |
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 // Garbage collector. | 5 // Garbage collector. |
6 | 6 |
7 #include "runtime.h" | 7 #include "runtime.h" |
8 #include "arch_GOARCH.h" | 8 #include "arch_GOARCH.h" |
9 #include "malloc.h" | 9 #include "malloc.h" |
10 #include "stack.h" | 10 #include "stack.h" |
(...skipping 2280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2291 next = fb->next; | 2291 next = fb->next; |
2292 for(i=0; i<fb->cnt; i++) { | 2292 for(i=0; i<fb->cnt; i++) { |
2293 f = &fb->fin[i]; | 2293 f = &fb->fin[i]; |
2294 framesz = sizeof(uintptr) + f->nret; | 2294 framesz = sizeof(uintptr) + f->nret; |
2295 if(framecap < framesz) { | 2295 if(framecap < framesz) { |
2296 runtime·free(frame); | 2296 runtime·free(frame); |
2297 // The frame does not contain pointers i
nteresting for GC, | 2297 // The frame does not contain pointers i
nteresting for GC, |
2298 // all not yet finalized objects are sto
red in finc. | 2298 // all not yet finalized objects are sto
red in finc. |
2299 // If we do not mark it as FlagNoPointer
s, | 2299 // If we do not mark it as FlagNoPointer
s, |
2300 // the last finalized object is not coll
ected. | 2300 // the last finalized object is not coll
ected. |
2301 » » » » » frame = runtime·mallocgc(framesz, FlagNo
Pointers, 0, 1); | 2301 » » » » » frame = runtime·mallocgc(framesz, 0, Fla
gNoPointers|FlagNoInvokeGC); |
2302 framecap = framesz; | 2302 framecap = framesz; |
2303 } | 2303 } |
2304 *(void**)frame = f->arg; | 2304 *(void**)frame = f->arg; |
2305 reflect·call(f->fn, frame, sizeof(uintptr) + f->
nret); | 2305 reflect·call(f->fn, frame, sizeof(uintptr) + f->
nret); |
2306 f->fn = nil; | 2306 f->fn = nil; |
2307 f->arg = nil; | 2307 f->arg = nil; |
2308 } | 2308 } |
2309 fb->cnt = 0; | 2309 fb->cnt = 0; |
2310 fb->next = finc; | 2310 fb->next = finc; |
2311 finc = fb; | 2311 finc = fb; |
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2509 uintptr n; | 2509 uintptr n; |
2510 | 2510 |
2511 n = (h->arena_used - h->arena_start) / wordsPerBitmapWord; | 2511 n = (h->arena_used - h->arena_start) / wordsPerBitmapWord; |
2512 n = ROUND(n, bitmapChunk); | 2512 n = ROUND(n, bitmapChunk); |
2513 if(h->bitmap_mapped >= n) | 2513 if(h->bitmap_mapped >= n) |
2514 return; | 2514 return; |
2515 | 2515 |
2516 runtime·SysMap(h->arena_start - n, n - h->bitmap_mapped); | 2516 runtime·SysMap(h->arena_start - n, n - h->bitmap_mapped); |
2517 h->bitmap_mapped = n; | 2517 h->bitmap_mapped = n; |
2518 } | 2518 } |
LEFT | RIGHT |