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

Delta Between Two Patch Sets: src/pkg/runtime/malloc.goc

Issue 4167041: code review 4167041: runtime: fix memory allocation on 386 (Closed)
Left Patch Set: diff -r 770fc1179efc https://go.googlecode.com/hg Created 14 years, 1 month ago
Right Patch Set: diff -r 770fc1179efc https://go.googlecode.com/hg Created 14 years, 1 month 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:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « no previous file | no next file » | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
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 211 matching lines...) Expand 10 before | Expand all | Expand 10 after
222 return c; 222 return c;
223 } 223 }
224 224
225 int32 runtime·sizeof_C_MStats = sizeof(MStats); 225 int32 runtime·sizeof_C_MStats = sizeof(MStats);
226 226
227 #define MaxArena32 (2U<<30) 227 #define MaxArena32 (2U<<30)
228 228
229 void 229 void
230 runtime·mallocinit(void) 230 runtime·mallocinit(void)
231 { 231 {
232 » byte *p, *q; 232 » byte *p;
233 uintptr arena_size, bitmap_size; 233 uintptr arena_size, bitmap_size;
234 extern byte end[]; 234 extern byte end[];
235 235
236 runtime·InitSizes(); 236 runtime·InitSizes();
237 237
238 // Set up the allocation arena, a contiguous area of memory where 238 // Set up the allocation arena, a contiguous area of memory where
239 // allocated data will be found. The arena begins with a bitmap large 239 // allocated data will be found. The arena begins with a bitmap large
240 // enough to hold 4 bits per allocated word. 240 // enough to hold 4 bits per allocated word.
241 if(sizeof(void*) == 8) { 241 if(sizeof(void*) == 8) {
242 // On a 64-bit machine, allocate from a single contiguous reserv ation. 242 // On a 64-bit machine, allocate from a single contiguous reserv ation.
(...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after
470 } 470 }
471 nret = (nret + sizeof(void*)-1) & ~(sizeof(void*)-1); 471 nret = (nret + sizeof(void*)-1) & ~(sizeof(void*)-1);
472 472
473 if(runtime·getfinalizer(obj.data, 0)) { 473 if(runtime·getfinalizer(obj.data, 0)) {
474 runtime·printf("runtime.SetFinalizer: finalizer already set"); 474 runtime·printf("runtime.SetFinalizer: finalizer already set");
475 goto throw; 475 goto throw;
476 } 476 }
477 } 477 }
478 runtime·addfinalizer(obj.data, finalizer.data, nret); 478 runtime·addfinalizer(obj.data, finalizer.data, nret);
479 } 479 }
LEFTRIGHT
« no previous file | no next file » | Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Toggle Comments ('s')

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