summaryrefslogtreecommitdiffstats
path: root/libmemunreachable
diff options
context:
space:
mode:
authorElliott Hughes <enh@google.com>2017-06-20 17:31:29 -0700
committerElliott Hughes <enh@google.com>2017-06-20 17:31:29 -0700
commit56731b4e2f9856a1d87a7672bfb621e68a5ad547 (patch)
treebf6f34d38b60f229b4093b3e41cf36558580903f /libmemunreachable
parentb001cc5b1c544efe5b0db5c7a10dd6efdb8fad4d (diff)
downloadcore-56731b4e2f9856a1d87a7672bfb621e68a5ad547.tar.gz
core-56731b4e2f9856a1d87a7672bfb621e68a5ad547.tar.bz2
core-56731b4e2f9856a1d87a7672bfb621e68a5ad547.zip
Shave a stack frame off asserts.
We can't implement MEM_LOG_ALWAYS_FATAL_IF any more, but it wasn't really useful anyway. Bug: N/A Test: ran `crasher assert` and `crasher64 assert` Change-Id: I4ae2d82fdfdd58cf8ef1dfb6c401cef4ba9d3e88
Diffstat (limited to 'libmemunreachable')
-rw-r--r--libmemunreachable/ScopedSignalHandler.h2
-rw-r--r--libmemunreachable/log.h4
2 files changed, 1 insertions, 5 deletions
diff --git a/libmemunreachable/ScopedSignalHandler.h b/libmemunreachable/ScopedSignalHandler.h
index ada2ae4ef..fab38ed3e 100644
--- a/libmemunreachable/ScopedSignalHandler.h
+++ b/libmemunreachable/ScopedSignalHandler.h
@@ -37,7 +37,7 @@ class ScopedSignalHandler {
template <class F>
void install(int signal, F&& f) {
- MEM_LOG_ALWAYS_FATAL_IF(signal_ != -1, "ScopedSignalHandler already installed");
+ if (signal != -1) MEM_LOG_ALWAYS_FATAL("ScopedSignalHandler already installed");
handler_ = SignalFn(std::allocator_arg, allocator_,
[=](int signal, siginfo_t* si, void* uctx) { f(*this, signal, si, uctx); });
diff --git a/libmemunreachable/log.h b/libmemunreachable/log.h
index 1725c53d7..10b83db21 100644
--- a/libmemunreachable/log.h
+++ b/libmemunreachable/log.h
@@ -30,9 +30,6 @@
#define MEM_LOG_ALWAYS_FATAL(...) async_safe_fatal(__VA_ARGS__)
-#define MEM_LOG_ALWAYS_FATAL_IF(cond, ...) \
- ((__predict_false(cond)) ? async_safe_fatal(__VA_ARGS__) : (void)0)
-
#else
#include <log/log.h>
@@ -43,7 +40,6 @@
#define MEM_ALOGI ALOGI
#define MEM_LOG_ALWAYS_FATAL LOG_ALWAYS_FATAL
-#define MEM_LOG_ALWAYS_FATAL_IF LOG_ALWAYS_FATAL_IF
#endif