:orphan: # PetscCalloc Allocates a cleared (zeroed) memory region aligned to `PETSC_MEMALIGN` ## Synopsis ``` #include 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 include/petscsys.h --- [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)