aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRon Yorston <rmy@pobox.com>2020-01-18 10:12:22 +0000
committerRon Yorston <rmy@pobox.com>2020-01-18 10:12:22 +0000
commita52570a15241be7378484a4d88a1099cb60aec1b (patch)
treea0ca1e2de193833edc19f355b15a11e5411ed89b
parent8e3dd0852bb87a41705cdd1fa0bf5336f1df4c1c (diff)
downloadbusybox-w32-a52570a15241be7378484a4d88a1099cb60aec1b.tar.gz
busybox-w32-a52570a15241be7378484a4d88a1099cb60aec1b.tar.bz2
busybox-w32-a52570a15241be7378484a4d88a1099cb60aec1b.zip
ash: reorder SAVE_PTR macros
Group together the code to mark pointers in the relocation map and that to store annotations. This allows some optimisations when forkshell debugging is enabled, saving 32 bytes.
-rw-r--r--shell/ash.c18
1 files changed, 8 insertions, 10 deletions
diff --git a/shell/ash.c b/shell/ash.c
index 8e80a5228..19babb80e 100644
--- a/shell/ash.c
+++ b/shell/ash.c
@@ -9449,15 +9449,14 @@ static union node *copynode(union node *);
9449} 9449}
9450# define SAVE_PTR2(dst1,note1,flag1,dst2,note2,flag2) { \ 9450# define SAVE_PTR2(dst1,note1,flag1,dst2,note2,flag2) { \
9451 if (relocate) { \ 9451 if (relocate) { \
9452 MARK_PTR(dst1,flag1); ANNOT(dst1,note1); \ 9452 MARK_PTR(dst1,flag1); MARK_PTR(dst2,flag2); \
9453 MARK_PTR(dst2,flag2); ANNOT(dst2,note2); \ 9453 ANNOT(dst1,note1); ANNOT(dst2,note2); \
9454 } \ 9454 } \
9455} 9455}
9456# define SAVE_PTR3(dst1,note1,flag1,dst2,note2,flag2,dst3,note3,flag3) { \ 9456# define SAVE_PTR3(dst1,note1,flag1,dst2,note2,flag2,dst3,note3,flag3) { \
9457 if (relocate) { \ 9457 if (relocate) { \
9458 MARK_PTR(dst1,flag1); ANNOT(dst1,note1); \ 9458 MARK_PTR(dst1,flag1); MARK_PTR(dst2,flag2); MARK_PTR(dst3,flag3); \
9459 MARK_PTR(dst2,flag2); ANNOT(dst2,note2); \ 9459 ANNOT(dst1,note1); ANNOT(dst2,note2); ANNOT(dst3,note3); \
9460 MARK_PTR(dst3,flag3); ANNOT(dst3,note3); \
9461 } \ 9460 } \
9462} 9461}
9463#else 9462#else
@@ -15508,13 +15507,12 @@ spawn_forkshell(struct forkshell *fs, struct job *jp, union node *n, int mode)
15508 MARK_PTR(dst,flag); ANNOT(dst,note); \ 15507 MARK_PTR(dst,flag); ANNOT(dst,note); \
15509} 15508}
15510# define SAVE_PTR2(dst1,note1,flag1,dst2,note2,flag2) { \ 15509# define SAVE_PTR2(dst1,note1,flag1,dst2,note2,flag2) { \
15511 MARK_PTR(dst1,flag1); ANNOT(dst1,note1); \ 15510 MARK_PTR(dst1,flag1); MARK_PTR(dst2,flag2); \
15512 MARK_PTR(dst2,flag2); ANNOT(dst2,note2); \ 15511 ANNOT(dst1,note1); ANNOT(dst2,note2); \
15513} 15512}
15514# define SAVE_PTR3(dst1,note1,flag1,dst2,note2,flag2,dst3,note3,flag3) { \ 15513# define SAVE_PTR3(dst1,note1,flag1,dst2,note2,flag2,dst3,note3,flag3) { \
15515 MARK_PTR(dst1,flag1); ANNOT(dst1,note1); \ 15514 MARK_PTR(dst1,flag1); MARK_PTR(dst2,flag2); MARK_PTR(dst3,flag3); \
15516 MARK_PTR(dst2,flag2); ANNOT(dst2,note2); \ 15515 ANNOT(dst1,note1); ANNOT(dst2,note2); ANNOT(dst3,note3); \
15517 MARK_PTR(dst3,flag3); ANNOT(dst3,note3); \
15518} 15516}
15519 15517
15520static int align_len(const char *s) 15518static int align_len(const char *s)