[compiler-rt] Log errno (or fuchsia equivalent) on map failures (PR #95391)
Vitaly Buka via llvm-commits
llvm-commits at lists.llvm.org
Thu Jun 13 11:19:00 PDT 2024
================
@@ -12,17 +12,28 @@
#include "gwp_asan/definitions.h"
#include <stddef.h>
+#include <stdint.h>
namespace gwp_asan {
// Terminates in a platform-specific way with `Message`.
void die(const char *Message);
+void dieWithErrorCode(const char *Message, int64_t ErrorCode);
// Checks that `Condition` is true, otherwise dies with `Message`.
-GWP_ASAN_ALWAYS_INLINE void Check(bool Condition, const char *Message) {
+GWP_ASAN_ALWAYS_INLINE void check(bool Condition, const char *Message) {
if (Condition)
return;
die(Message);
}
+
+// Checks that `Condition` is true, otherwise dies with `Message` (including
+// errno at the end).
+GWP_ASAN_ALWAYS_INLINE void
+checkWithErrorCode(bool Condition, const char *Message, int64_t ErrorCode) {
+ if (Condition)
----------------
vitalybuka wrote:
you may want `LIKELY` annotation
it makes noticable perf difference on hot code.
https://github.com/llvm/llvm-project/pull/95391
More information about the llvm-commits
mailing list