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

Side by Side Diff: src/pkg/runtime/malloc.goc

Issue 6114046: code review 6114046: runtime, reflect, ld, gc: garbage collection precision ... (Closed)
Patch Set: diff -r dcb835ff82e0 https://code.google.com/p/go/ Created 11 years 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/cmd/gc/reflect.c ('k') | src/pkg/runtime/mgc0.h » ('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 // See malloc.h for overview. 5 // See malloc.h for overview.
6 // 6 //
7 // TODO(rsc): double-check stats. 7 // TODO(rsc): double-check stats.
8 8
9 package runtime 9 package runtime
10 #include "runtime.h" 10 #include "runtime.h"
(...skipping 472 matching lines...) Expand 10 before | Expand all | Expand 10 after
483 void *v; 483 void *v;
484 uintptr typ, p; 484 uintptr typ, p;
485 MSpan *s; 485 MSpan *s;
486 486
487 buf = mp->settype_buf; 487 buf = mp->settype_buf;
488 endbuf = buf + mp->settype_bufsize; 488 endbuf = buf + mp->settype_bufsize;
489 489
490 runtime·lock(&settype_lock); 490 runtime·lock(&settype_lock);
491 while(buf < endbuf) { 491 while(buf < endbuf) {
492 v = (void*)*buf; 492 v = (void*)*buf;
493 » » *buf = 0; 493 » » if(false) *buf = 0;
rsc 2013/12/18 04:08:19 What's this?
494 buf++; 494 buf++;
495 typ = *buf; 495 typ = *buf;
496 buf++; 496 buf++;
497 497
498 // (Manually inlined copy of runtime·MHeap_Lookup) 498 // (Manually inlined copy of runtime·MHeap_Lookup)
499 p = (uintptr)v>>PageShift; 499 p = (uintptr)v>>PageShift;
500 if(sizeof(void*) == 8) 500 if(sizeof(void*) == 8)
501 p -= (uintptr)runtime·mheap->arena_start >> PageShift; 501 p -= (uintptr)runtime·mheap->arena_start >> PageShift;
502 s = runtime·mheap->map[p]; 502 s = runtime·mheap->map[p];
503 503
(...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after
799 runtime·printf("runtime.SetFinalizer: finalizer already set\n"); 799 runtime·printf("runtime.SetFinalizer: finalizer already set\n");
800 goto throw; 800 goto throw;
801 } 801 }
802 return; 802 return;
803 803
804 badfunc: 804 badfunc:
805 runtime·printf("runtime.SetFinalizer: second argument is %S, not func(%S )\n", *finalizer.type->string, *obj.type->string); 805 runtime·printf("runtime.SetFinalizer: second argument is %S, not func(%S )\n", *finalizer.type->string, *obj.type->string);
806 throw: 806 throw:
807 runtime·throw("runtime.SetFinalizer"); 807 runtime·throw("runtime.SetFinalizer");
808 } 808 }
OLDNEW
« no previous file with comments | « src/cmd/gc/reflect.c ('k') | src/pkg/runtime/mgc0.h » ('j') | no next file with comments »

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