mirror of
https://github.com/golang/go
synced 2024-11-19 22:44:45 -07:00
runtime: add (unused for now) gc field to type information
R=rsc CC=golang-dev https://golang.org/cl/6255074
This commit is contained in:
parent
322057cbfc
commit
65e61d5770
@ -546,14 +546,16 @@ dcommontype(Sym *s, int ot, Type *t)
|
|||||||
// ../../pkg/reflect/type.go:/^type.commonType
|
// ../../pkg/reflect/type.go:/^type.commonType
|
||||||
// actual type structure
|
// actual type structure
|
||||||
// type commonType struct {
|
// type commonType struct {
|
||||||
// size uintptr;
|
// size uintptr
|
||||||
// hash uint32;
|
// hash uint32
|
||||||
// alg uint8;
|
// _ uint8
|
||||||
// align uint8;
|
// align uint8
|
||||||
// fieldAlign uint8;
|
// fieldAlign uint8
|
||||||
// kind uint8;
|
// kind uint8
|
||||||
// string *string;
|
// alg unsafe.Pointer
|
||||||
// *extraType;
|
// gc unsafe.Pointer
|
||||||
|
// string *string
|
||||||
|
// *extraType
|
||||||
// ptrToThis *Type
|
// ptrToThis *Type
|
||||||
// }
|
// }
|
||||||
ot = duintptr(s, ot, t->width);
|
ot = duintptr(s, ot, t->width);
|
||||||
@ -579,6 +581,7 @@ dcommontype(Sym *s, int ot, Type *t)
|
|||||||
ot = dsymptr(s, ot, algarray, alg*sizeofAlg);
|
ot = dsymptr(s, ot, algarray, alg*sizeofAlg);
|
||||||
else
|
else
|
||||||
ot = dsymptr(s, ot, algsym, 0);
|
ot = dsymptr(s, ot, algsym, 0);
|
||||||
|
ot = duintptr(s, ot, 0); // gc
|
||||||
p = smprint("%-uT", t);
|
p = smprint("%-uT", t);
|
||||||
//print("dcommontype: %s\n", p);
|
//print("dcommontype: %s\n", p);
|
||||||
ot = dgostringptr(s, ot, p); // string
|
ot = dgostringptr(s, ot, p); // string
|
||||||
|
@ -775,7 +775,7 @@ enum {
|
|||||||
KindNoPointers = 1<<7,
|
KindNoPointers = 1<<7,
|
||||||
|
|
||||||
// size of Type interface header + CommonType structure.
|
// size of Type interface header + CommonType structure.
|
||||||
CommonSize = 2*PtrSize+ 5*PtrSize + 8,
|
CommonSize = 2*PtrSize+ 6*PtrSize + 8,
|
||||||
};
|
};
|
||||||
|
|
||||||
static Reloc*
|
static Reloc*
|
||||||
|
@ -244,6 +244,7 @@ type commonType struct {
|
|||||||
fieldAlign uint8 // alignment of struct field with this type
|
fieldAlign uint8 // alignment of struct field with this type
|
||||||
kind uint8 // enumeration for C
|
kind uint8 // enumeration for C
|
||||||
alg *uintptr // algorithm table (../runtime/runtime.h:/Alg)
|
alg *uintptr // algorithm table (../runtime/runtime.h:/Alg)
|
||||||
|
gc uintptr // garbage collection data
|
||||||
string *string // string form; unnecessary but undeniably useful
|
string *string // string form; unnecessary but undeniably useful
|
||||||
*uncommonType // (relatively) uncommon fields
|
*uncommonType // (relatively) uncommon fields
|
||||||
ptrToThis *runtimeType // pointer to this type, if used in binary or has methods
|
ptrToThis *runtimeType // pointer to this type, if used in binary or has methods
|
||||||
|
@ -21,7 +21,8 @@ type commonType struct {
|
|||||||
align uint8
|
align uint8
|
||||||
fieldAlign uint8
|
fieldAlign uint8
|
||||||
kind uint8
|
kind uint8
|
||||||
alg *uintptr
|
alg unsafe.Pointer
|
||||||
|
gc unsafe.Pointer
|
||||||
string *string
|
string *string
|
||||||
*uncommonType
|
*uncommonType
|
||||||
ptrToThis *interface{}
|
ptrToThis *interface{}
|
||||||
|
@ -28,6 +28,7 @@ struct CommonType
|
|||||||
uint8 fieldAlign;
|
uint8 fieldAlign;
|
||||||
uint8 kind;
|
uint8 kind;
|
||||||
Alg *alg;
|
Alg *alg;
|
||||||
|
void *gc;
|
||||||
String *string;
|
String *string;
|
||||||
UncommonType *x;
|
UncommonType *x;
|
||||||
Type *ptrto;
|
Type *ptrto;
|
||||||
|
Loading…
Reference in New Issue
Block a user