Add wrapper for __msan_unpoinson() to reduce #ifdeffery
This isn't really necessary for the subsequent commit, but I expect that we'll need to unpoison more often once we turn on msan in CI, so I think think this change makes sense in the long run.
This commit is contained in:
@@ -8,6 +8,10 @@
|
||||
|
||||
#include "macro.h"
|
||||
|
||||
#if HAS_FEATURE_MEMORY_SANITIZER
|
||||
# include <sanitizer/msan_interface.h>
|
||||
#endif
|
||||
|
||||
typedef void (*free_func_t)(void *p);
|
||||
|
||||
/* If for some reason more than 4M are allocated on the stack, let's abort immediately. It's better than
|
||||
@@ -160,3 +164,9 @@ void* greedy_realloc0(void **p, size_t *allocated, size_t need, size_t size);
|
||||
(ptr) = NULL; \
|
||||
_ptr_; \
|
||||
})
|
||||
|
||||
#if HAS_FEATURE_MEMORY_SANITIZER
|
||||
# define msan_unpoison(r, s) __msan_unpoison(r, s)
|
||||
#else
|
||||
# define msan_unpoison(r, s)
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user