[all-commits] [llvm/llvm-project] 024495: [demangler] Improve buffer hysteresis

Nathan Sidwell via All-commits all-commits at lists.llvm.org
Tue Mar 1 04:38:38 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 024495e62660a51edd060b57a95ca68d584d3b43
      https://github.com/llvm/llvm-project/commit/024495e62660a51edd060b57a95ca68d584d3b43
  Author: Nathan Sidwell <nathan at acm.org>
  Date:   2022-03-01 (Tue, 01 Mar 2022)

  Changed paths:
    M libcxxabi/src/demangle/Utility.h
    M llvm/include/llvm/Demangle/Utility.h
    M llvm/unittests/Demangle/OutputBufferTest.cpp

  Log Message:
  -----------
  [demangler] Improve buffer hysteresis

Improve demangler buffer hysteresis.  If we needed more than double
the buffer, the original code would allocate exactly the amount
needed, and thus consequently the next request would also realloc.
We're very unlikely to get into wanting more than double, after the
first allocation, as it would require the user to have used an
identifier larger than the hysteresis.  With machine generated code
that's possible, but unlikely.

Reviewed By: ChuanqiXu

Differential Revision: https://reviews.llvm.org/D119972




More information about the All-commits mailing list