:orphan:
# PetscCalloc3
Allocates 3 cleared (zeroed) arrays of memory, all aligned to `PETSC_MEMALIGN` 
## Synopsis
```
#include <petscsys.h>
PetscErrorCode PetscCalloc3(size_t m1,type **r1,size_t m2,type **r2,size_t m3,type **r3)
```
Not Collective


## Input Parameters

- ***m1 -*** number of elements to allocate in 1st chunk  (may be zero)
- ***m2 -*** number of elements to allocate in 2nd chunk  (may be zero)
- ***m3 -*** number of elements to allocate in 3rd chunk  (may be zero)



## Output Parameters

- ***r1 -*** memory allocated in first chunk
- ***r2 -*** memory allocated in second chunk
- ***r3 -*** memory allocated in third chunk





## See Also
 `PetscFree()`, `PetscNew()`, `PetscMalloc()`, `PetscCalloc2()`, `PetscMalloc3()`, `PetscFree3()`

## Level
developer

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

## Examples
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ksp/ksp/tutorials/bench_kspsolve.c.html">src/ksp/ksp/tutorials/bench_kspsolve.c</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ts/tutorials/ex53.c.html">src/ts/tutorials/ex53.c</A><BR>


---
[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](/manualpages/index.md)  
[Index of all manual pages](/manualpages/singleindex.md)  
