mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-05-28 00:02:28 +00:00
Optimize memory layout
This commit is contained in:
parent
0305194d98
commit
b69f3d2488
41 changed files with 383 additions and 347 deletions
9
third_party/zlib/inffast.c
vendored
9
third_party/zlib/inffast.c
vendored
|
@ -122,8 +122,7 @@ void inflate_fast(z_streamp strm, unsigned start) {
|
|||
bits -= op;
|
||||
op = (unsigned)(here.op);
|
||||
if (op == 0) { /* literal */
|
||||
Tracevv((stderr,
|
||||
here.val >= 0x20 && here.val < 0x7f
|
||||
Tracevv((here.val >= 0x20 && here.val < 0x7f
|
||||
? "inflate: literal '%c'\n"
|
||||
: "inflate: literal 0x%02x\n",
|
||||
here.val));
|
||||
|
@ -140,7 +139,7 @@ void inflate_fast(z_streamp strm, unsigned start) {
|
|||
hold >>= op;
|
||||
bits -= op;
|
||||
}
|
||||
Tracevv((stderr, "inflate: length %u\n", len));
|
||||
Tracevv(("inflate: length %u\n", len));
|
||||
if (bits < 15) {
|
||||
hold += (unsigned long)(*in++) << bits;
|
||||
bits += 8;
|
||||
|
@ -174,7 +173,7 @@ void inflate_fast(z_streamp strm, unsigned start) {
|
|||
#endif
|
||||
hold >>= op;
|
||||
bits -= op;
|
||||
Tracevv((stderr, "inflate: distance %u\n", dist));
|
||||
Tracevv(("inflate: distance %u\n", dist));
|
||||
op = (unsigned)(out - beg); /* max distance in output */
|
||||
if (dist > op) { /* see if copy from window */
|
||||
op = dist - op; /* distance back in window */
|
||||
|
@ -277,7 +276,7 @@ void inflate_fast(z_streamp strm, unsigned start) {
|
|||
here = lcode[here.val + (hold & ((1U << op) - 1))];
|
||||
goto dolen;
|
||||
} else if (op & 32) { /* end-of-block */
|
||||
Tracevv((stderr, "inflate: end of block\n"));
|
||||
Tracevv(("inflate: end of block\n"));
|
||||
state->mode = TYPE;
|
||||
break;
|
||||
} else {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue