[PATCH] D121512: [Support] zlib::compress: replace compress2 with iterative deflate

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Mar 12 15:43:40 PST 2022


MaskRay added a comment.

In D121512#3377511 <https://reviews.llvm.org/D121512#3377511>, @joerg wrote:

> But that doesn't really matter much as long as it is uninitialized virtual memory? This is almost always used for a very short time as well.

I agree this complexity is unneeded. Then abandon this patch and replace `return Res ? createError(convertZlibCodeToString(Res)) : Error::success();` with something like

  if (Res == Z_MEM_ERROR)
    report_bad_alloc_error("Allocation failed"); // like llvm/include/llvm/Support/MemAlloc.h safe_malloc, which may be called by resize_for_overwrite if oom
  return Error::success();

?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D121512/new/

https://reviews.llvm.org/D121512



More information about the llvm-commits mailing list