~ubuntu-branches/ubuntu/vivid/golang/vivid

« back to all changes in this revision

Viewing changes to src/pkg/runtime/type.h

  • Committer: Package Import Robot
  • Author(s): James Page
  • Date: 2013-08-20 14:06:23 UTC
  • mfrom: (14.1.23 saucy-proposed)
  • Revision ID: package-import@ubuntu.com-20130820140623-b414jfxi3m0qkmrq
Tags: 2:1.1.2-2ubuntu1
* Merge from Debian unstable (LP: #1211749, #1202027). Remaining changes:
  - 016-armhf-elf-header.patch: Use correct ELF header for armhf binaries.
  - d/control,control.cross: Update Breaks/Replaces for Ubuntu
    versions to ensure smooth upgrades, regenerate control file.

Show diffs side-by-side

added added

removed removed

Lines of Context:
5
5
/*
6
6
 * Runtime type representation; master is type.go
7
7
 *
8
 
 * The *Types here correspond 1-1 to type.go's *Type's, but are
9
 
 * prefixed with an extra header of 2 pointers, corresponding to the
10
 
 * interface{} structure, which itself is called type Type again on
11
 
 * the Go side.
 
8
 * The Type*s here correspond 1-1 to type.go's *rtype.
12
9
 */
13
10
 
14
 
typedef struct CommonType CommonType;
 
11
typedef struct Type Type;
15
12
typedef struct UncommonType UncommonType;
16
13
typedef struct InterfaceType InterfaceType;
17
14
typedef struct Method Method;
18
15
typedef struct IMethod IMethod;
19
16
typedef struct SliceType SliceType;
20
17
typedef struct FuncType FuncType;
 
18
typedef struct PtrType PtrType;
21
19
 
22
 
struct CommonType
 
20
// Needs to be in sync with typekind.h/CommonSize
 
21
struct Type
23
22
{
24
23
        uintptr size;
25
24
        uint32 hash;
28
27
        uint8 fieldAlign;
29
28
        uint8 kind;
30
29
        Alg *alg;
 
30
        void *gc;
31
31
        String *string;
32
32
        UncommonType *x;
33
33
        Type *ptrto;
34
34
};
35
35
 
36
 
enum {
37
 
        KindBool = 1,
38
 
        KindInt,
39
 
        KindInt8,
40
 
        KindInt16,
41
 
        KindInt32,
42
 
        KindInt64,
43
 
        KindUint,
44
 
        KindUint8,
45
 
        KindUint16,
46
 
        KindUint32,
47
 
        KindUint64,
48
 
        KindUintptr,
49
 
        KindFloat32,
50
 
        KindFloat64,
51
 
        KindComplex64,
52
 
        KindComplex128,
53
 
        KindArray,
54
 
        KindChan,
55
 
        KindFunc,
56
 
        KindInterface,
57
 
        KindMap,
58
 
        KindPtr,
59
 
        KindSlice,
60
 
        KindString,
61
 
        KindStruct,
62
 
        KindUnsafePointer,
63
 
        
64
 
        KindNoPointers = 1<<7,
65
 
};
66
 
 
67
36
struct Method
68
37
{
69
38
        String *name;
82
51
        Method m[];
83
52
};
84
53
 
85
 
struct Type
86
 
{
87
 
        void *type;     // interface{} value
88
 
        void *ptr;
89
 
        CommonType;
90
 
};
91
 
 
92
54
struct IMethod
93
55
{
94
56
        String *name;
130
92
        Slice in;
131
93
        Slice out;
132
94
};
 
95
 
 
96
struct PtrType
 
97
{
 
98
        Type;
 
99
        Type *elem;
 
100
};