]> git.ipfire.org Git - thirdparty/zstd.git/commitdiff
Shrink Table Valid End During Alloc Alignment / Phase Change
authorW. Felix Handte <w@felixhandte.com>
Wed, 11 Sep 2019 21:03:09 +0000 (17:03 -0400)
committerW. Felix Handte <w@felixhandte.com>
Wed, 11 Sep 2019 21:14:59 +0000 (17:14 -0400)
lib/compress/zstd_cwksp.h

index 98499b86fa8853b518fb91a029aa424e3fec9c11..39d064c4906b30fa87be8760c6ec1fb9c3661a0c 100644 (file)
@@ -184,6 +184,9 @@ MEM_STATIC void ZSTD_cwksp_internal_advance_phase(
              * by a larger margin than the space that will be consumed. */
             /* TODO: cleaner, compiler warning friendly way to do this??? */
             ws->allocStart = (BYTE*)ws->allocStart - ((size_t)ws->allocStart & (sizeof(U32)-1));
+            if (ws->allocStart < ws->tableValidEnd) {
+                ws->tableValidEnd = ws->allocStart;
+            }
         }
         ws->phase = phase;
     }