diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2018-02-03 22:52:11 +0100 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2018-02-03 22:52:55 +0100 |
commit | 0e60a36c929e57e47d5de8e1ac0e53d4ec185a70 (patch) | |
tree | 7b4d97fa01ff39c203efd36863c6653b3afb3a11 | |
parent | 86be6d5ba9df8b8237a8c3edc2a844aaa63bd559 (diff) | |
download | busybox-w32-0e60a36c929e57e47d5de8e1ac0e53d4ec185a70.tar.gz busybox-w32-0e60a36c929e57e47d5de8e1ac0e53d4ec185a70.tar.bz2 busybox-w32-0e60a36c929e57e47d5de8e1ac0e53d4ec185a70.zip |
bzip2: move runningOrder[] back to stack - 256 bytes is not much
function old new delta
mainSort 1119 1108 -11
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r-- | archival/libarchive/bz/blocksort.c | 13 | ||||
-rw-r--r-- | archival/libarchive/bz/bzlib_private.h | 1 |
2 files changed, 8 insertions, 6 deletions
diff --git a/archival/libarchive/bz/blocksort.c b/archival/libarchive/bz/blocksort.c index 7c5b6c552..0a9a597d0 100644 --- a/archival/libarchive/bz/blocksort.c +++ b/archival/libarchive/bz/blocksort.c | |||
@@ -113,9 +113,8 @@ void fallbackQSort3(uint32_t* fmap, | |||
113 | int32_t loSt, | 113 | int32_t loSt, |
114 | int32_t hiSt) | 114 | int32_t hiSt) |
115 | { | 115 | { |
116 | int32_t unLo, unHi, ltLo, gtHi, n, m; | 116 | int32_t sp; |
117 | int32_t sp, lo, hi; | 117 | uint32_t r; |
118 | uint32_t med, r, r3; | ||
119 | int32_t stackLo[FALLBACK_QSORT_STACK_SIZE]; | 118 | int32_t stackLo[FALLBACK_QSORT_STACK_SIZE]; |
120 | int32_t stackHi[FALLBACK_QSORT_STACK_SIZE]; | 119 | int32_t stackHi[FALLBACK_QSORT_STACK_SIZE]; |
121 | 120 | ||
@@ -125,6 +124,11 @@ void fallbackQSort3(uint32_t* fmap, | |||
125 | fpush(loSt, hiSt); | 124 | fpush(loSt, hiSt); |
126 | 125 | ||
127 | while (sp > 0) { | 126 | while (sp > 0) { |
127 | int32_t unLo, unHi, ltLo, gtHi, n, m; | ||
128 | int32_t lo, hi; | ||
129 | uint32_t med; | ||
130 | uint32_t r3; | ||
131 | |||
128 | AssertH(sp < FALLBACK_QSORT_STACK_SIZE - 1, 1004); | 132 | AssertH(sp < FALLBACK_QSORT_STACK_SIZE - 1, 1004); |
129 | 133 | ||
130 | fpop(lo, hi); | 134 | fpop(lo, hi); |
@@ -730,12 +734,11 @@ void mainSort(EState* state) | |||
730 | { | 734 | { |
731 | int32_t i, j; | 735 | int32_t i, j; |
732 | Bool bigDone[256]; | 736 | Bool bigDone[256]; |
733 | /* bbox: moved to EState to save stack | ||
734 | uint8_t runningOrder[256]; | 737 | uint8_t runningOrder[256]; |
738 | /* bbox: moved to EState to save stack | ||
735 | int32_t copyStart[256]; | 739 | int32_t copyStart[256]; |
736 | int32_t copyEnd [256]; | 740 | int32_t copyEnd [256]; |
737 | */ | 741 | */ |
738 | #define runningOrder (state->mainSort__runningOrder) | ||
739 | #define copyStart (state->mainSort__copyStart) | 742 | #define copyStart (state->mainSort__copyStart) |
740 | #define copyEnd (state->mainSort__copyEnd) | 743 | #define copyEnd (state->mainSort__copyEnd) |
741 | 744 | ||
diff --git a/archival/libarchive/bz/bzlib_private.h b/archival/libarchive/bz/bzlib_private.h index 8b8bbe3eb..ef75ef08a 100644 --- a/archival/libarchive/bz/bzlib_private.h +++ b/archival/libarchive/bz/bzlib_private.h | |||
@@ -196,7 +196,6 @@ typedef struct EState { | |||
196 | int32_t BZ2_hbMakeCodeLengths__weight[BZ_MAX_ALPHA_SIZE * 2]; | 196 | int32_t BZ2_hbMakeCodeLengths__weight[BZ_MAX_ALPHA_SIZE * 2]; |
197 | int32_t BZ2_hbMakeCodeLengths__parent[BZ_MAX_ALPHA_SIZE * 2]; | 197 | int32_t BZ2_hbMakeCodeLengths__parent[BZ_MAX_ALPHA_SIZE * 2]; |
198 | 198 | ||
199 | uint8_t mainSort__runningOrder[256]; | ||
200 | int32_t mainSort__copyStart[256]; | 199 | int32_t mainSort__copyStart[256]; |
201 | int32_t mainSort__copyEnd[256]; | 200 | int32_t mainSort__copyEnd[256]; |
202 | } EState; | 201 | } EState; |