Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
G
golang
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
go
golang
Commits
89ec208e
Commit
89ec208e
authored
Jan 04, 2013
by
Jan Ziak
Committed by
Russ Cox
Jan 04, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
runtime: introduce typedefs and delete struct keywords in mgc0.c
R=rsc CC=golang-dev
https://golang.org/cl/7029055
parent
98edf09e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
13 deletions
+16
-13
mgc0.c
src/pkg/runtime/mgc0.c
+16
-13
No files found.
src/pkg/runtime/mgc0.c
View file @
89ec208e
...
...
@@ -163,12 +163,14 @@ enum {
// is moved/flushed to the work buffer (Workbuf).
// The size of an intermediate buffer is very small,
// such as 32 or 64 elements.
typedef
struct
PtrTarget
PtrTarget
;
struct
PtrTarget
{
void
*
p
;
uintptr
ti
;
};
typedef
struct
BitTarget
BitTarget
;
struct
BitTarget
{
void
*
p
;
...
...
@@ -176,13 +178,14 @@ struct BitTarget
uintptr
*
bitp
,
shift
;
};
typedef
struct
BufferList
BufferList
;
struct
BufferList
{
struct
PtrTarget
ptrtarget
[
IntermediateBufferCapacity
];
struct
BitTarget
bittarget
[
IntermediateBufferCapacity
];
struct
BufferList
*
next
;
PtrTarget
ptrtarget
[
IntermediateBufferCapacity
];
BitTarget
bittarget
[
IntermediateBufferCapacity
];
BufferList
*
next
;
};
static
struct
BufferList
*
bufferList
;
static
BufferList
*
bufferList
;
static
Lock
lock
;
...
...
@@ -207,7 +210,7 @@ static Lock lock;
// flushptrbuf
// (2nd part, mark and enqueue)
static
void
flushptrbuf
(
struct
PtrTarget
*
ptrbuf
,
uintptr
n
,
Obj
**
_wp
,
Workbuf
**
_wbuf
,
uintptr
*
_nobj
,
struct
BitTarget
*
bitbuf
)
flushptrbuf
(
PtrTarget
*
ptrbuf
,
uintptr
n
,
Obj
**
_wp
,
Workbuf
**
_wbuf
,
uintptr
*
_nobj
,
BitTarget
*
bitbuf
)
{
byte
*
p
,
*
arena_start
,
*
obj
;
uintptr
size
,
*
bitp
,
bits
,
shift
,
j
,
x
,
xbits
,
off
,
nobj
,
ti
;
...
...
@@ -215,8 +218,8 @@ flushptrbuf(struct PtrTarget *ptrbuf, uintptr n, Obj **_wp, Workbuf **_wbuf, uin
PageID
k
;
Obj
*
wp
;
Workbuf
*
wbuf
;
struct
PtrTarget
*
ptrbuf_end
;
struct
BitTarget
*
bitbufpos
,
*
bt
;
PtrTarget
*
ptrbuf_end
;
BitTarget
*
bitbufpos
,
*
bt
;
arena_start
=
runtime
·
mheap
.
arena_start
;
...
...
@@ -323,7 +326,7 @@ flushptrbuf(struct PtrTarget *ptrbuf, uintptr n, Obj **_wp, Workbuf **_wbuf, uin
if
((
bits
&
(
bitAllocated
|
bitMarked
))
!=
bitAllocated
)
continue
;
*
bitbufpos
=
(
struct
BitTarget
){
obj
,
ti
,
bitp
,
shift
};
*
bitbufpos
=
(
BitTarget
){
obj
,
ti
,
bitp
,
shift
};
bitbufpos
++
;
}
...
...
@@ -398,11 +401,11 @@ scanblock(Workbuf *wbuf, Obj *wp, uintptr nobj, bool keepworking)
uintptr
*
pc
;
struct
BufferList
*
scanbuffers
;
struct
PtrTarget
*
ptrbuf
,
*
ptrbuf_end
;
struct
BitTarget
*
bitbuf
;
BufferList
*
scanbuffers
;
PtrTarget
*
ptrbuf
,
*
ptrbuf_end
;
BitTarget
*
bitbuf
;
struct
PtrTarget
*
ptrbufpos
;
PtrTarget
*
ptrbufpos
;
// End of local variable declarations.
...
...
@@ -462,7 +465,7 @@ scanblock(Workbuf *wbuf, Obj *wp, uintptr nobj, bool keepworking)
obj
=
*
(
byte
**
)
i
;
if
(
obj
>=
arena_start
&&
obj
<
arena_used
)
{
*
ptrbufpos
=
(
struct
PtrTarget
){
obj
,
0
};
*
ptrbufpos
=
(
PtrTarget
){
obj
,
0
};
ptrbufpos
++
;
if
(
ptrbufpos
==
ptrbuf_end
)
goto
flush_buffers
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment