runtime: move type kinds into a separate file

R=rsc
CC=golang-dev
https://golang.org/cl/6285047
This commit is contained in:
Jan Ziak 2012-06-06 17:20:02 -04:00 committed by Russ Cox
parent c8cbbd31f0
commit ede6718cd7
5 changed files with 42 additions and 31 deletions

View File

@ -5,6 +5,7 @@
#include "runtime.h"
#include "arch_GOARCH.h"
#include "type.h"
#include "typekind.h"
#include "malloc.h"
void

View File

@ -13,6 +13,7 @@ package runtime
#include "malloc.h"
#include "defs_GOOS_GOARCH.h"
#include "type.h"
#include "typekind.h"
#pragma dataflag 16 /* mark mheap as 'no pointers', hiding from garbage collector */
MHeap runtime·mheap;

View File

@ -5,6 +5,7 @@
#include "runtime.h"
#include "arch_GOARCH.h"
#include "type.h"
#include "typekind.h"
#include "malloc.h"
static int32 debug = 0;

View File

@ -19,6 +19,7 @@ typedef struct IMethod IMethod;
typedef struct SliceType SliceType;
typedef struct FuncType FuncType;
// Needs to be in sync with typekind.h/CommonSize
struct CommonType
{
uintptr size;
@ -34,37 +35,6 @@ struct CommonType
Type *ptrto;
};
enum {
KindBool = 1,
KindInt,
KindInt8,
KindInt16,
KindInt32,
KindInt64,
KindUint,
KindUint8,
KindUint16,
KindUint32,
KindUint64,
KindUintptr,
KindFloat32,
KindFloat64,
KindComplex64,
KindComplex128,
KindArray,
KindChan,
KindFunc,
KindInterface,
KindMap,
KindPtr,
KindSlice,
KindString,
KindStruct,
KindUnsafePointer,
KindNoPointers = 1<<7,
};
struct Method
{
String *name;

View File

@ -0,0 +1,38 @@
// Copyright 2012 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
enum {
KindBool = 1,
KindInt,
KindInt8,
KindInt16,
KindInt32,
KindInt64,
KindUint,
KindUint8,
KindUint16,
KindUint32,
KindUint64,
KindUintptr,
KindFloat32,
KindFloat64,
KindComplex64,
KindComplex128,
KindArray,
KindChan,
KindFunc,
KindInterface,
KindMap,
KindPtr,
KindSlice,
KindString,
KindStruct,
KindUnsafePointer,
KindNoPointers = 1<<7,
// size of Type interface header + CommonType structure.
CommonSize = 2*sizeof(void*) + 6*sizeof(void*) + 8,
};