aboutsummaryrefslogtreecommitdiff
path: root/archival/bz/compress.c
diff options
context:
space:
mode:
authorDenis Vlasenko <vda.linux@googlemail.com>2007-12-02 08:35:37 +0000
committerDenis Vlasenko <vda.linux@googlemail.com>2007-12-02 08:35:37 +0000
commitab801874f852312787c049272c20b14e06ed8195 (patch)
tree1cfd38cfe48ed6a6625ce559ab7f3e5778a980be /archival/bz/compress.c
parent8003e266edbc0ec62a586dd70dcc80dc13e2dbf0 (diff)
downloadbusybox-w32-ab801874f852312787c049272c20b14e06ed8195.tar.gz
busybox-w32-ab801874f852312787c049272c20b14e06ed8195.tar.bz2
busybox-w32-ab801874f852312787c049272c20b14e06ed8195.zip
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/compress.c')
-rw-r--r--archival/bz/compress.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/archival/bz/compress.c b/archival/bz/compress.c
index b72edbbd4..640b8872b 100644
--- a/archival/bz/compress.c
+++ b/archival/bz/compress.c
@@ -264,13 +264,16 @@ void sendMTFValues(EState* s)
264 * are also globals only used in this proc. 264 * are also globals only used in this proc.
265 * Made global to keep stack frame size small. 265 * Made global to keep stack frame size small.
266 */ 266 */
267#define code sendMTFValues__code
268#define rfreq sendMTFValues__rfreq
269#define len_pack sendMTFValues__len_pack
267 270
268 uint16_t cost[BZ_N_GROUPS]; 271 uint16_t cost[BZ_N_GROUPS];
269 int32_t fave[BZ_N_GROUPS]; 272 int32_t fave[BZ_N_GROUPS];
270 273
271 uint16_t* mtfv = s->mtfv; 274 uint16_t* mtfv = s->mtfv;
272 275
273 alphaSize = s->nInUse+2; 276 alphaSize = s->nInUse + 2;
274 for (t = 0; t < BZ_N_GROUPS; t++) 277 for (t = 0; t < BZ_N_GROUPS; t++)
275 for (v = 0; v < alphaSize; v++) 278 for (v = 0; v < alphaSize; v++)
276 s->len[t][v] = BZ_GREATER_ICOST; 279 s->len[t][v] = BZ_GREATER_ICOST;
@@ -453,7 +456,7 @@ void sendMTFValues(EState* s)
453 /* maxLen was changed from 20 to 17 in bzip2-1.0.3. See 456 /* maxLen was changed from 20 to 17 in bzip2-1.0.3. See
454 * comment in huffman.c for details. */ 457 * comment in huffman.c for details. */
455 for (t = 0; t < nGroups; t++) 458 for (t = 0; t < nGroups; t++)
456 BZ2_hbMakeCodeLengths(&(s->len[t][0]), &(s->rfreq[t][0]), alphaSize, 17 /*20*/); 459 BZ2_hbMakeCodeLengths(s, &(s->len[t][0]), &(s->rfreq[t][0]), alphaSize, 17 /*20*/);
457 } 460 }
458 461
459 AssertH(nGroups < 8, 3002); 462 AssertH(nGroups < 8, 3002);
@@ -602,6 +605,9 @@ void sendMTFValues(EState* s)
602 selCtr++; 605 selCtr++;
603 } 606 }
604 AssertH(selCtr == nSelectors, 3007); 607 AssertH(selCtr == nSelectors, 3007);
608#undef code
609#undef rfreq
610#undef len_pack
605} 611}
606 612
607 613