From 872ec72de447b2803894e17253399a54a4c10e1f Mon Sep 17 00:00:00 2001 From: Santiago Aboy Solanes Date: Fri, 18 Feb 2022 14:10:25 +0000 Subject: Update compiler/ implications to use (D)CHECK_IMPLIES Follow-up to aosp/1988868 in which we added the (D)CHECK_IMPLIES macro. This CL uses it on compiler/ occurrences found by a regex. Test: art/test/testrunner/testrunner.py --host --64 --optimizing -b Change-Id: If63aed969bfb8b31d6fbbcb3bca2b04314c894b7 --- compiler/utils/swap_space.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'compiler/utils/swap_space.h') diff --git a/compiler/utils/swap_space.h b/compiler/utils/swap_space.h index a472943518..827e9a6366 100644 --- a/compiler/utils/swap_space.h +++ b/compiler/utils/swap_space.h @@ -26,6 +26,7 @@ #include +#include "base/logging.h" #include "base/macros.h" #include "base/mutex.h" @@ -179,7 +180,7 @@ class SwapAllocator { DCHECK_LE(n, max_size()); if (swap_space_ == nullptr) { T* result = reinterpret_cast(malloc(n * sizeof(T))); - CHECK(result != nullptr || n == 0u); // Abort if malloc() fails. + CHECK_IMPLIES(result == nullptr, n == 0u); // Abort if malloc() fails. return result; } else { return reinterpret_cast(swap_space_->Alloc(n * sizeof(T))); -- cgit v1.2.3-59-g8ed1b