Commit e69012ce authored by Dmitriy Vyukov's avatar Dmitriy Vyukov

runtime: use enums instead static vars for debugging

Compiler can detect and delete dead code with enums,
but can not with static vars.

R=golang-dev, dave, r
CC=golang-dev
https://golang.org/cl/9377043
parent 5a89b35b
...@@ -11,8 +11,6 @@ ...@@ -11,8 +11,6 @@
#define MAXALIGN 7 #define MAXALIGN 7
#define NOSELGEN 1 #define NOSELGEN 1
static int32 debug = 0;
typedef struct WaitQ WaitQ; typedef struct WaitQ WaitQ;
typedef struct SudoG SudoG; typedef struct SudoG SudoG;
typedef struct Select Select; typedef struct Select Select;
...@@ -58,6 +56,8 @@ uint32 runtime·Hchansize = sizeof(Hchan); ...@@ -58,6 +56,8 @@ uint32 runtime·Hchansize = sizeof(Hchan);
enum enum
{ {
debug = 0,
// Scase.kind // Scase.kind
CaseRecv, CaseRecv,
CaseSend, CaseSend,
......
...@@ -9,7 +9,10 @@ ...@@ -9,7 +9,10 @@
#include "malloc.h" #include "malloc.h"
#include "race.h" #include "race.h"
static bool debug = 0; enum
{
debug = 0
};
static void makeslice1(SliceType*, intgo, intgo, Slice*); static void makeslice1(SliceType*, intgo, intgo, Slice*);
static void growslice1(SliceType*, Slice, intgo, Slice *); static void growslice1(SliceType*, Slice, intgo, Slice *);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment