[all-commits] [llvm/llvm-project] c14c83: [libcxxabi] Make fallback malloc heap size configu...

Yuxuan Chen via All-commits all-commits at lists.llvm.org
Wed Feb 11 17:52:49 PST 2026


  Branch: refs/heads/users/yuxuanchen1997/libcxxabi-fallback-heap-size
  Home:   https://github.com/llvm/llvm-project
  Commit: c14c838a86d7f740f08109459ec7bc2e58d1766d
      https://github.com/llvm/llvm-project/commit/c14c838a86d7f740f08109459ec7bc2e58d1766d
  Author: Yuxuan Chen <ych at meta.com>
  Date:   2026-02-11 (Wed, 11 Feb 2026)

  Changed paths:
    M libcxxabi/CMakeLists.txt
    M libcxxabi/src/fallback_malloc.cpp

  Log Message:
  -----------
  [libcxxabi] Make fallback malloc heap size configurable via CMake

The emergency fallback heap used during exception handling when
malloc() fails (e.g. under OOM) was hardcoded to 512 bytes, which
is only enough for a few in-flight exceptions. In contrast, libstdc++
reserves ~73 KiB for this purpose.

Add a LIBCXXABI_FALLBACK_MALLOC_HEAP_SIZE CMake option (default 512)
so that builds targeting programs that need to survive OOM conditions
can increase the pool size. Validate the value at both CMake configure
time and C++ compile time, since the heap's unsigned short offsets
limit it to ~256 KiB.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list