]> Cypherpunks repositories - gostls13.git/commitdiff
runtime: avoid defining the same variable in more than one translation unit
authorShenghou Ma <minux.ma@gmail.com>
Sat, 26 Jan 2013 01:57:06 +0000 (09:57 +0800)
committerShenghou Ma <minux.ma@gmail.com>
Sat, 26 Jan 2013 01:57:06 +0000 (09:57 +0800)
For gccgo runtime and Darwin where -fno-common is the default.

R=iant, dave
CC=golang-dev
https://golang.org/cl/7094061

src/pkg/runtime/malloc.goc
src/pkg/runtime/malloc.h
src/pkg/runtime/proc.c
src/pkg/runtime/runtime.h

index f437c0e3f0ff1da062f9715dcf8014deec664ab3..ad3ad5e7db3bd2cdaa825baeb15b5dd8ce6177ad 100644 (file)
@@ -19,6 +19,8 @@ package runtime
 #pragma dataflag 16 /* mark mheap as 'no pointers', hiding from garbage collector */
 MHeap runtime·mheap;
 
+int32  runtime·checking;
+
 extern MStats mstats;  // defined in zruntime_def_$GOOS_$GOARCH.go
 
 extern volatile intgo runtime·MemProfileRate;
index e6138cfaec941b85f76e8b56c603256a7a783436..2c34398a72e9c429740e092d340e020417d7d950 100644 (file)
@@ -446,7 +446,7 @@ void        runtime·markallocated(void *v, uintptr n, bool noptr);
 void   runtime·checkallocated(void *v, uintptr n);
 void   runtime·markfreed(void *v, uintptr n);
 void   runtime·checkfreed(void *v, uintptr n);
-int32  runtime·checking;
+extern int32   runtime·checking;
 void   runtime·markspan(void *v, uintptr size, uintptr n, bool leftover);
 void   runtime·unmarkspan(void *v, uintptr size);
 bool   runtime·blockspecial(void*);
index 5219071b9a21076d74314f54a873b2c91a6be19c..cd66bcecdb7a1f392c90b38ce13c0adb869ba46c 100644 (file)
@@ -24,6 +24,13 @@ static       int32   debug   = 0;
 
 int32  runtime·gcwaiting;
 
+G*     runtime·allg;
+G*     runtime·lastg;
+M*     runtime·allm;
+
+int8*  runtime·goos;
+int32  runtime·ncpu;
+
 // Go scheduler
 //
 // The go scheduler's job is to match ready-to-run goroutines (`g's)
index 47a7b6e78b9c9948a1b3aa94bd78be56bbade8fb..e21c276e179e854278d464c25b73962054c6601b 100644 (file)
@@ -562,15 +562,15 @@ struct Panic
  */
 extern String  runtime·emptystring;
 extern uintptr runtime·zerobase;
-G*     runtime·allg;
-G*     runtime·lastg;
-M*     runtime·allm;
+extern G*      runtime·allg;
+extern G*      runtime·lastg;
+extern M*      runtime·allm;
 extern int32   runtime·gomaxprocs;
 extern bool    runtime·singleproc;
 extern uint32  runtime·panicking;
 extern int32   runtime·gcwaiting;             // gc is waiting to run
-int8*  runtime·goos;
-int32  runtime·ncpu;
+extern int8*   runtime·goos;
+extern int32   runtime·ncpu;
 extern bool    runtime·iscgo;
 extern         void    (*runtime·sysargs)(int32, uint8**);
 extern uint32  runtime·maxstring;