:orphan:
# PetscIsRegionPoisoned
Query whether a particular memory region is poisoned 
## Synopsis
```
static inline PetscErrorCode PetscIsRegionPoisoned(const void *ptr, size_t size, PetscBool3 *poisoned)
```

## Input Parameters

- ***ptr  -*** The pointer to the start of the region
- ***size -*** The size (in bytes) of the region to query



## Output Parameter

- ***poisoned -*** Whether the region is known to be poisoned



## Notes
Sets `poisoned` to `PETSC_BOOL3_TRUE` if at least 1 byte in the range [`ptr`, `ptr + size`) is
poisoned. Therefore a region must be entirely unpoisoned for `poisoned` to be `PETSC_BOOL3_FALSE`.

If `ptr` is `NULL` or `size` is `0` then `poisoned` is set to `PETSC_BOOL3_FALSE`.

If it is not possible to query the poisoned status of a region, then `poisoned` is set to
`PETSC_BOOL3_UNKNOWN`.




## See Also
 `PetscPoisonMemoryRegion()`, `PetscUnpoisonMemoryRegion()`

## Level
developer

## Location
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/include/petsc/private/mempoison.h.html#PetscIsRegionPoisoned">include/petsc/private/mempoison.h</A>


---
[Edit on GitLab](https://gitlab.com/petsc/petsc/-/edit/release/include/petsc/private/mempoison.h)


[Index of all Sys routines](index.md)  
[Table of Contents for all manual pages](/manualpages/index.md)  
[Index of all manual pages](/manualpages/singleindex.md)  
