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

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

Issue 10136043: code review 10136043: runtime: refactor mallocgc (Closed)
Left Patch Set: diff -r dc24634de6c5 https://dvyukov%40google.com@code.google.com/p/go/ Created 11 years, 8 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/mfinal.c ('k') | src/pkg/runtime/proc.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
(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
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
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 }
LEFTRIGHT

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