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

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

Issue 5490053: code review 5490053: runtime: make more build-friendly (Closed)
Left Patch Set: Created 13 years, 3 months ago
Right Patch Set: diff -r 046739c8299b https://go.googlecode.com/hg/ Created 13 years, 3 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/mgc0.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 // Fixed-size object allocator. Returned memory is not zeroed. 5 // Fixed-size object allocator. Returned memory is not zeroed.
6 // 6 //
7 // See malloc.h for overview. 7 // See malloc.h for overview.
8 8
9 #include "runtime.h" 9 #include "runtime.h"
10 #include "arch.h" 10 #include "arch_GOARCH.h"
11 #include "malloc.h" 11 #include "malloc.h"
12 12
13 // Initialize f to allocate objects of the given size, 13 // Initialize f to allocate objects of the given size,
14 // using the allocator to obtain chunks of memory. 14 // using the allocator to obtain chunks of memory.
15 void 15 void
16 runtime·FixAlloc_Init(FixAlloc *f, uintptr size, void *(*alloc)(uintptr), void ( *first)(void*, byte*), void *arg) 16 runtime·FixAlloc_Init(FixAlloc *f, uintptr size, void *(*alloc)(uintptr), void ( *first)(void*, byte*), void *arg)
17 { 17 {
18 f->size = size; 18 f->size = size;
19 f->alloc = alloc; 19 f->alloc = alloc;
20 f->first = first; 20 f->first = first;
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
54 } 54 }
55 55
56 void 56 void
57 runtime·FixAlloc_Free(FixAlloc *f, void *p) 57 runtime·FixAlloc_Free(FixAlloc *f, void *p)
58 { 58 {
59 f->inuse -= f->size; 59 f->inuse -= f->size;
60 *(void**)p = f->list; 60 *(void**)p = f->list;
61 f->list = p; 61 f->list = p;
62 } 62 }
63 63
LEFTRIGHT

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