]> Cypherpunks repositories - gostls13.git/commitdiff
runtime: move Itab to runtime.h
authorJan Ziak <0xe2.0x9a.0x9b@gmail.com>
Thu, 1 Nov 2012 17:13:20 +0000 (13:13 -0400)
committerRuss Cox <rsc@golang.org>
Thu, 1 Nov 2012 17:13:20 +0000 (13:13 -0400)
The 'type' field of Itab will be used by the garbage collector.

R=rsc
CC=golang-dev
https://golang.org/cl/6815059

src/pkg/runtime/iface.c
src/pkg/runtime/runtime.h

index 5566d88e3bbd7cef101735c977ae8203e5144c7c..634c9e98f6a0241c2f07a037afb290e0abcf1e61 100644 (file)
@@ -20,19 +20,6 @@ runtime·printeface(Eface e)
        runtime·printf("(%p,%p)", e.type, e.data);
 }
 
-/*
- * layout of Itab known to compilers
- */
-struct Itab
-{
-       InterfaceType*  inter;
-       Type*   type;
-       Itab*   link;
-       int32   bad;
-       int32   unused;
-       void    (*fun[])(void);
-};
-
 static Itab*   hash[1009];
 static Lock    ifacelock;
 
index cd2f6f0587d7760b20f9e4a0c8c03f2219544eb9..51a5aeca91fa780e039d21748cadd97c77d4cd62 100644 (file)
@@ -62,6 +62,7 @@ typedef       struct  MCache          MCache;
 typedef        struct  FixAlloc        FixAlloc;
 typedef        struct  Iface           Iface;
 typedef        struct  Itab            Itab;
+typedef        struct  InterfaceType   InterfaceType;
 typedef        struct  Eface           Eface;
 typedef        struct  Type            Type;
 typedef        struct  ChanType                ChanType;
@@ -322,6 +323,17 @@ struct     Func
        int32   locals; // number of 32-bit locals
 };
 
+// layout of Itab known to compilers
+struct Itab
+{
+       InterfaceType*  inter;
+       Type*   type;
+       Itab*   link;
+       int32   bad;
+       int32   unused;
+       void    (*fun[])(void);
+};
+
 struct WinCall
 {
        void    (*fn)(void*);
@@ -823,7 +835,7 @@ void        runtime·chansend(ChanType*, Hchan*, byte*, bool*, void*);
 void   runtime·chanrecv(ChanType*, Hchan*, byte*, bool*, bool*);
 bool   runtime·showframe(Func*);
 
-void   runtime·ifaceE2I(struct InterfaceType*, Eface, Iface*);
+void   runtime·ifaceE2I(InterfaceType*, Eface, Iface*);
 
 uintptr        runtime·memlimit(void);