std::core::sanitizer::asan

poison_memory_region

macro poison_memory_region(void* addr, usz size)
Marks a memory region ([addr, addr+size)) as unaddressable.

This memory must be previously allocated by your program. Instrumented
code is forbidden from accessing addresses in this region until it is
unpoisoned. This function is not guaranteed to poison the entire region -
it could poison only a subregion of [addr, addr+size) due to ASan
alignment restrictions.

NOTE This function is not thread-safe because no two threads can poison or
unpoison memory in the same memory region simultaneously.

Parameters