hc
2024-05-10 37f49e37ab4cb5d0bc4c60eb5c6d4dd57db767bb
kernel/lib/decompress_inflate.c
....@@ -10,6 +10,10 @@
1010 #include "zlib_inflate/inftrees.c"
1111 #include "zlib_inflate/inffast.c"
1212 #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
1317
1418 #else /* STATIC */
1519 /* initramfs et al: linked */
....@@ -76,7 +80,12 @@
7680 }
7781
7882 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
7987 sizeof(struct inflate_state));
88
+#endif
8089 if (strm->workspace == NULL) {
8190 error("Out of memory while allocating workspace");
8291 goto gunzip_nomem4;
....@@ -123,10 +132,14 @@
123132
124133 rc = zlib_inflateInit2(strm, -MAX_WBITS);
125134
135
+#ifdef CONFIG_ZLIB_DFLTCC
136
+ /* Always keep the window for DFLTCC */
137
+#else
126138 if (!flush) {
127139 WS(strm)->inflate_state.wsize = 0;
128140 WS(strm)->inflate_state.window = NULL;
129141 }
142
+#endif
130143
131144 while (rc == Z_OK) {
132145 if (strm->avail_in == 0) {