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
65e61d57
Commit
65e61d57
authored
Jun 02, 2012
by
Jan Ziak
Committed by
Russ Cox
Jun 02, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
runtime: add (unused for now) gc field to type information
R=rsc CC=golang-dev
https://golang.org/cl/6255074
parent
322057cb
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
16 additions
and
10 deletions
+16
-10
reflect.c
src/cmd/gc/reflect.c
+11
-8
dwarf.c
src/cmd/ld/dwarf.c
+1
-1
type.go
src/pkg/reflect/type.go
+1
-0
type.go
src/pkg/runtime/type.go
+2
-1
type.h
src/pkg/runtime/type.h
+1
-0
No files found.
src/cmd/gc/reflect.c
View file @
65e61d57
...
...
@@ -546,14 +546,16 @@ dcommontype(Sym *s, int ot, Type *t)
// ../../pkg/reflect/type.go:/^type.commonType
// actual type structure
// type commonType struct {
// size uintptr;
// hash uint32;
// alg uint8;
// align uint8;
// fieldAlign uint8;
// kind uint8;
// string *string;
// *extraType;
// size uintptr
// hash uint32
// _ uint8
// align uint8
// fieldAlign uint8
// kind uint8
// alg unsafe.Pointer
// gc unsafe.Pointer
// string *string
// *extraType
// ptrToThis *Type
// }
ot
=
duintptr
(
s
,
ot
,
t
->
width
);
...
...
@@ -579,6 +581,7 @@ dcommontype(Sym *s, int ot, Type *t)
ot
=
dsymptr
(
s
,
ot
,
algarray
,
alg
*
sizeofAlg
);
else
ot
=
dsymptr
(
s
,
ot
,
algsym
,
0
);
ot
=
duintptr
(
s
,
ot
,
0
);
// gc
p
=
smprint
(
"%-uT"
,
t
);
//print("dcommontype: %s\n", p);
ot
=
dgostringptr
(
s
,
ot
,
p
);
// string
...
...
src/cmd/ld/dwarf.c
View file @
65e61d57
...
...
@@ -775,7 +775,7 @@ enum {
KindNoPointers
=
1
<<
7
,
// size of Type interface header + CommonType structure.
CommonSize
=
2
*
PtrSize
+
5
*
PtrSize
+
8
,
CommonSize
=
2
*
PtrSize
+
6
*
PtrSize
+
8
,
};
static
Reloc
*
...
...
src/pkg/reflect/type.go
View file @
65e61d57
...
...
@@ -244,6 +244,7 @@ type commonType struct {
fieldAlign
uint8
// alignment of struct field with this type
kind
uint8
// enumeration for C
alg
*
uintptr
// algorithm table (../runtime/runtime.h:/Alg)
gc
uintptr
// garbage collection data
string
*
string
// string form; unnecessary but undeniably useful
*
uncommonType
// (relatively) uncommon fields
ptrToThis
*
runtimeType
// pointer to this type, if used in binary or has methods
...
...
src/pkg/runtime/type.go
View file @
65e61d57
...
...
@@ -21,7 +21,8 @@ type commonType struct {
align
uint8
fieldAlign
uint8
kind
uint8
alg
*
uintptr
alg
unsafe
.
Pointer
gc
unsafe
.
Pointer
string
*
string
*
uncommonType
ptrToThis
*
interface
{}
...
...
src/pkg/runtime/type.h
View file @
65e61d57
...
...
@@ -28,6 +28,7 @@ struct CommonType
uint8
fieldAlign
;
uint8
kind
;
Alg
*
alg
;
void
*
gc
;
String
*
string
;
UncommonType
*
x
;
Type
*
ptrto
;
...
...
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