.. | .. |
---|
10 | 10 | #include "zlib_inflate/inftrees.c" |
---|
11 | 11 | #include "zlib_inflate/inffast.c" |
---|
12 | 12 | #include "zlib_inflate/inflate.c" |
---|
| 13 | +#ifdef CONFIG_ZLIB_DFLTCC |
---|
| 14 | +#include "zlib_dfltcc/dfltcc.c" |
---|
| 15 | +#include "zlib_dfltcc/dfltcc_inflate.c" |
---|
| 16 | +#endif |
---|
13 | 17 | |
---|
14 | 18 | #else /* STATIC */ |
---|
15 | 19 | /* initramfs et al: linked */ |
---|
.. | .. |
---|
76 | 80 | } |
---|
77 | 81 | |
---|
78 | 82 | strm->workspace = malloc(flush ? zlib_inflate_workspacesize() : |
---|
| 83 | +#ifdef CONFIG_ZLIB_DFLTCC |
---|
| 84 | + /* Always allocate the full workspace for DFLTCC */ |
---|
| 85 | + zlib_inflate_workspacesize()); |
---|
| 86 | +#else |
---|
79 | 87 | sizeof(struct inflate_state)); |
---|
| 88 | +#endif |
---|
80 | 89 | if (strm->workspace == NULL) { |
---|
81 | 90 | error("Out of memory while allocating workspace"); |
---|
82 | 91 | goto gunzip_nomem4; |
---|
.. | .. |
---|
123 | 132 | |
---|
124 | 133 | rc = zlib_inflateInit2(strm, -MAX_WBITS); |
---|
125 | 134 | |
---|
| 135 | +#ifdef CONFIG_ZLIB_DFLTCC |
---|
| 136 | + /* Always keep the window for DFLTCC */ |
---|
| 137 | +#else |
---|
126 | 138 | if (!flush) { |
---|
127 | 139 | WS(strm)->inflate_state.wsize = 0; |
---|
128 | 140 | WS(strm)->inflate_state.window = NULL; |
---|
129 | 141 | } |
---|
| 142 | +#endif |
---|
130 | 143 | |
---|
131 | 144 | while (rc == Z_OK) { |
---|
132 | 145 | if (strm->avail_in == 0) { |
---|