llvm-project/libcxxabi
Nathan Sidwell 5b3ca24a35 [demangler] Simplify OutputBuffer initialization
Every non-testcase use of OutputBuffer contains code to allocate an
initial buffer (using either 128 or 1024 as initial guesses). There's
now no need to do that, given recent changes to the buffer extension
heuristics -- it allocates a 1k(ish) buffer on first need.

Just pass in a buffer (if any) to the constructor.  Thus the
OutputBuffer's ownership of the buffer starts at its own lifetime
start. We can reduce the lifetime of this object in several cases.

That new constructor takes a 'size_t *' for the size argument, as all
uses with a non-null buffer are passing through a malloc'd buffer from
their own caller in this manner.

The buffer reset member function is never used, and is deleted.

The original buffer initialization code would return a failure code if
that first malloc failed.  Existing code either ignored that, called
std::terminate with a FIXME, or returned an error code.

But that's not foolproof anyway, as a subsequent buffer extension
failure ends up calling std::terminate. I am working on addressing
that unfortunate failure mode in a manner more consistent with the C++
ABI design.

Reviewed By: dblaikie

Differential Revision: https://reviews.llvm.org/D122604
2022-04-26 04:23:12 -07:00
..
cmake [runtimes] [CMake] Unify variable names 2022-04-24 13:06:36 +03:00
fuzz
include [libc++] Revert "Protect users from relying on detail headers" & related changes 2022-03-01 08:20:24 -05:00
lib [libc++/abi] Revert "[libc++] Move the weak symbols list to libc++abi" 2020-10-05 11:42:13 -04:00
src [demangler] Simplify OutputBuffer initialization 2022-04-26 04:23:12 -07:00
test [demangler] Support C23 _BitInt type 2022-04-08 12:20:45 +08:00
www [runtimes] Remove support for standalone builds 2022-02-09 08:55:31 -05:00
.clang-format [NFC][libcxxabi] Run clang-format on libcxxabi/src/cxa_guard_impl.h 2021-08-18 19:09:16 -04:00
.gitignore
CMakeLists.txt [runtimes] [CMake] Unify variable names 2022-04-24 13:06:36 +03:00
CREDITS.TXT
LICENSE.TXT Fix typos throughout the license files that somehow I and my reviewers 2019-01-21 09:52:34 +00:00