1 // Copyright 2024 The Chromium Authors 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 5 #ifndef BASE_MEMORY_ASAN_INTERFACE_H_ 6 #define BASE_MEMORY_ASAN_INTERFACE_H_ 7 8 // This header is a convenience wrapper that allows other code to avoid needing 9 // to check `#if defined(ADDRESS_SANITIZER) ...`. 10 11 #if defined(ADDRESS_SANITIZER) 12 #include <sanitizer/asan_interface.h> 13 #else 14 #define ASAN_POISON_MEMORY_REGION(addr, size) ((void)(addr), (void)(size)) 15 #define ASAN_UNPOISON_MEMORY_REGION(addr, size) ((void)(addr), (void)(size)) 16 #endif 17 18 #endif // BASE_MEMORY_ASAN_INTERFACE_H_ 19