[all-commits] [llvm/llvm-project] 56f28d: [asan] Allow OOM Policy Injection in Allocator::Al...
Justin T. Gibbs via All-commits
all-commits at lists.llvm.org
Sun May 31 23:06:21 PDT 2026
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: 56f28d538f737bcd50081f75fbb8c01d0bc80c38
https://github.com/llvm/llvm-project/commit/56f28d538f737bcd50081f75fbb8c01d0bc80c38
Author: Justin T. Gibbs <gibbs at scsiguy.com>
Date: 2026-05-31 (Sun, 31 May 2026)
Changed paths:
M compiler-rt/lib/asan/asan_allocator.cpp
Log Message:
-----------
[asan] Allow OOM Policy Injection in Allocator::Allocate API (#196413)
Groundwork for #196388.
Allocator::Allocate() previously unconditionally applied the global
OOM policy as dictated by the AllocatorMayReturnNull() flag: return
nullptr or abort via Report*+Die(). Introduce Allocator::AllocateImpl()
which delegates this decision to the caller via its 'may_return_null'
boolean parameter, allowing future changes to the operator new
implementation to fully control this behavior.
Implementation:
* Rename Allocator::Allocate(...) to Allocator::AllocateImpl(...) and
add a may_return_null parameter that replaces the three internal
AllocatorMayReturnNull() calls (RSS limit, oversize, OOM).
* Reintroduce Allocator::Allocate(...) as a thin wrapper that calls
AllocateImpl(..., AllocatorMayReturnNull()), preserving the
flag-deferring semantics for every existing caller.
NFC.
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