[compiler-rt] [sanitizer_common] Add operator new chain-handling framework (PR #201151)
David Justo via llvm-commits
llvm-commits at lists.llvm.org
Sat Jun 13 11:55:44 PDT 2026
================
@@ -0,0 +1,118 @@
+//===-- sanitizer_new_operators.inc -----------------------------*- C++ -*-===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+//
+// Shared OPERATOR_NEW_BODY* macros for sanitizer operator new overrides.
+//
+// All eight variants compose the same per-call setup (a sanitizer-specific
+// stack-trace acquisition) with one of the two chain-handling templates from
+// sanitizer_new_handler.h and two sanitizer-supplied lambdas: an Alloc that
+// invokes the sanitizer's internal allocator (returning nullptr on failure)
+// and an OnExhausted that calls the sanitizer's "abort with diagnostic"
+// handler.
+//
+// This file is included after the consuming TU has defined the ingredient
----------------
davidmrdavid wrote:
subjective / non-blocking nit - I'd replace 'ingredient' with 'pre-requisite'. "Ingredient" makes me think of food :).
```suggestion
// This file is included after the consuming TU has defined the pre-reqsuite
```
https://github.com/llvm/llvm-project/pull/201151
More information about the llvm-commits
mailing list