summaryrefslogtreecommitdiff
path: root/editors
diff options
context:
space:
mode:
authorDenis Vlasenko2008-02-27 18:41:59 +0000
committerDenis Vlasenko2008-02-27 18:41:59 +0000
commit574f2f43948bb21d6e4187936ba5a5afccba25f6 (patch)
tree0b39aca564149e5ad30b3cc791228655ff1b1827 /editors
parentfe66a0eca1bfeae0abc0fc1e7d3709f271e05e82 (diff)
downloadbusybox-574f2f43948bb21d6e4187936ba5a5afccba25f6.zip
busybox-574f2f43948bb21d6e4187936ba5a5afccba25f6.tar.gz
*: add optimization barrier to all "G trick" locations
Diffstat (limited to 'editors')
-rw-r--r--editors/awk.c7
-rw-r--r--editors/diff.c2
-rw-r--r--editors/ed.c2
-rw-r--r--editors/vi.c2
4 files changed, 7 insertions, 6 deletions
diff --git a/editors/awk.c b/editors/awk.c
index 983b311..f04ea5c 100644
--- a/editors/awk.c
+++ b/editors/awk.c
@@ -394,7 +394,8 @@ static const uint16_t PRIMES[] ALIGN2 = { 251, 1021, 4093, 16381, 65521 };
/* Globals. Split in two parts so that first one is addressed
* with (mostly short) negative offsets */
struct globals {
- chain beginseq, mainseq, endseq, *seq;
+ chain beginseq, mainseq, endseq;
+ chain *seq;
node *break_ptr, *continue_ptr;
rstream *iF;
xhash *vhash, *ahash, *fdhash, *fnhash;
@@ -445,7 +446,7 @@ struct globals2 {
tsplitter fsplitter, rsplitter;
};
#define G1 (ptr_to_globals[-1])
-#define G (*(struct globals2 *const)ptr_to_globals)
+#define G (*(struct globals2 *)ptr_to_globals)
/* For debug. nm --size-sort awk.o | grep -vi ' [tr] ' */
/* char G1size[sizeof(G1)]; - 0x6c */
/* char Gsize[sizeof(G)]; - 0x1cc */
@@ -485,7 +486,7 @@ struct globals2 {
#define fsplitter (G.fsplitter )
#define rsplitter (G.rsplitter )
#define INIT_G() do { \
- PTR_TO_GLOBALS = xzalloc(sizeof(G1) + sizeof(G)) + sizeof(G1); \
+ SET_PTR_TO_GLOBALS(xzalloc(sizeof(G1) + sizeof(G)) + sizeof(G1)); \
G.next_token__ltclass = TC_OPTERM; \
G.evaluate__seed = 1; \
} while (0)
diff --git a/editors/diff.c b/editors/diff.c
index 64b7daa..8844ec1 100644
--- a/editors/diff.c
+++ b/editors/diff.c
@@ -151,7 +151,7 @@ struct globals {
#define stb1 (G.stb1 )
#define stb2 (G.stb2 )
#define INIT_G() do { \
- PTR_TO_GLOBALS = xzalloc(sizeof(G)); \
+ SET_PTR_TO_GLOBALS(xzalloc(sizeof(G))); \
context = 3; \
max_context = 64; \
} while (0)
diff --git a/editors/ed.c b/editors/ed.c
index a569788..15f0147 100644
--- a/editors/ed.c
+++ b/editors/ed.c
@@ -51,7 +51,7 @@ struct globals {
#define lines (G.lines )
#define marks (G.marks )
#define INIT_G() do { \
- PTR_TO_GLOBALS = xzalloc(sizeof(G)); \
+ SET_PTR_TO_GLOBALS(xzalloc(sizeof(G))); \
} while (0)
diff --git a/editors/vi.c b/editors/vi.c
index 6f4bd06..d2d2670 100644
--- a/editors/vi.c
+++ b/editors/vi.c
@@ -233,7 +233,7 @@ struct globals {
#define readbuffer (G.readbuffer )
#define scr_out_buf (G.scr_out_buf )
#define INIT_G() do { \
- PTR_TO_GLOBALS = xzalloc(sizeof(G)); \
+ SET_PTR_TO_GLOBALS(xzalloc(sizeof(G))); \
} while (0)
static int init_text_buffer(char *); // init from file or create new