diff options
author | Denis Vlasenko | 2007-12-02 08:35:37 +0000 |
---|---|---|
committer | Denis Vlasenko | 2007-12-02 08:35:37 +0000 |
commit | ab801874f852312787c049272c20b14e06ed8195 (patch) | |
tree | 1cfd38cfe48ed6a6625ce559ab7f3e5778a980be /archival/bz/bzlib_private.h | |
parent | 8003e266edbc0ec62a586dd70dcc80dc13e2dbf0 (diff) | |
download | busybox-ab801874f852312787c049272c20b14e06ed8195.zip busybox-ab801874f852312787c049272c20b14e06ed8195.tar.gz |
attack the biggest stack users:
-mkfs_minix_main [busybox_unstripped]: 4288
-mkfs_minix_main [busybox_unstripped]: 4276
-grave [busybox_unstripped]: 4260
(bzip2 users too - not listed)
price we pay in code size increase:
mainSort 2458 2515 +57
grave 1005 1058 +53
sendMTFValues 2177 2195 +18
BZ2_blockSort 122 125 +3
mkfs_minix_main 3070 3022 -48
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 4/1 up/down: 131/-48) Total: 83 bytes
Diffstat (limited to 'archival/bz/bzlib_private.h')
-rw-r--r-- | archival/bz/bzlib_private.h | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/archival/bz/bzlib_private.h b/archival/bz/bzlib_private.h index 02f177e..48676a3 100644 --- a/archival/bz/bzlib_private.h +++ b/archival/bz/bzlib_private.h @@ -178,13 +178,22 @@ typedef struct EState { uint8_t selector [BZ_MAX_SELECTORS]; uint8_t selectorMtf[BZ_MAX_SELECTORS]; - uint8_t len [BZ_N_GROUPS][BZ_MAX_ALPHA_SIZE]; - int32_t code [BZ_N_GROUPS][BZ_MAX_ALPHA_SIZE]; - int32_t rfreq[BZ_N_GROUPS][BZ_MAX_ALPHA_SIZE]; + uint8_t len[BZ_N_GROUPS][BZ_MAX_ALPHA_SIZE]; + + /* stack-saving measures: these can be local, but they are too big */ + int32_t sendMTFValues__code [BZ_N_GROUPS][BZ_MAX_ALPHA_SIZE]; + int32_t sendMTFValues__rfreq[BZ_N_GROUPS][BZ_MAX_ALPHA_SIZE]; #if CONFIG_BZIP2_FEATURE_SPEED >= 5 /* second dimension: only 3 needed; 4 makes index calculations faster */ - uint32_t len_pack[BZ_MAX_ALPHA_SIZE][4]; + uint32_t sendMTFValues__len_pack[BZ_MAX_ALPHA_SIZE][4]; #endif + int32_t BZ2_hbMakeCodeLengths__heap [BZ_MAX_ALPHA_SIZE + 2]; + int32_t BZ2_hbMakeCodeLengths__weight[BZ_MAX_ALPHA_SIZE * 2]; + int32_t BZ2_hbMakeCodeLengths__parent[BZ_MAX_ALPHA_SIZE * 2]; + + int32_t mainSort__runningOrder[256]; + int32_t mainSort__copyStart[256]; + int32_t mainSort__copyEnd[256]; } EState; @@ -203,7 +212,7 @@ static void BZ2_hbAssignCodes(int32_t*, uint8_t*, int32_t, int32_t, int32_t); static void -BZ2_hbMakeCodeLengths(uint8_t*, int32_t*, int32_t, int32_t); +BZ2_hbMakeCodeLengths(EState*, uint8_t*, int32_t*, int32_t, int32_t); /*-------------------------------------------------------------*/ /*--- end bzlib_private.h ---*/ |