|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [PATCH v10 2/9] xen: do not free reserved memory into heap
On 24.08.22 11:03, Julien Grall wrote: Hi, On 16/08/2022 07:40, Jan Beulich wrote:On 16.08.2022 04:36, Penny Zheng wrote:
What about something like the following then?
--- a/xen/include/xen/lib.h
+++ b/xen/include/xen/lib.h
@@ -40,6 +40,16 @@
unlikely(ret_warn_on_); \
})
+#define WARN_ONCE() do { \
+ static bool warned = false; \
+ \
+ if ( !warned ) \
+ { \
+ warned = true; \
+ WARN(); \
+ } \
+} while (0)
+
/* All clang versions supported by Xen have _Static_assert. */
#if defined(__clang__) || \
(__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6))
@@ -63,7 +73,7 @@
#define ASSERT_UNREACHABLE() assert_failed("unreachable")
#else
#define ASSERT(p) do { if ( 0 && (p) ) {} } while (0)
-#define ASSERT_UNREACHABLE() do { } while (0)
+#define ASSERT_UNREACHABLE() WARN_ONCE()
#endif
#define ABS(_x) ({ \
Juergen
Attachment:
OpenPGP_0xB0DE9DD628BF132F.asc Attachment:
OpenPGP_signature
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |