# PetscCalloc
Allocates a cleared (zeroed) memory region aligned to `PETSC_MEMALIGN` 
## Synopsis
```
#include <petscsys.h>
PetscErrorCode PetscCalloc(size_t m,void **result)
```
Not Collective


## Input Parameter

- ***m -*** number of bytes to allocate



## Output Parameter

- ***result -*** memory allocated





## Notes
Memory is always allocated at least double aligned. This macro is useful in allocating memory pointed by void pointers

It is safe to allocate size 0 and pass the resulting pointer (which may or may not be NULL) to PetscFree().


## See Also
 `PetscFree()`, `PetscNew()`


## Level
beginner

## Location
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/include/petscsys.h.html#PetscCalloc">include/petscsys.h</A>


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


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