petsc-dev 2014-02-02
Report Typos and Errors

PetscMalloc

Allocates memory

Synopsis

#include 
PetscErrorCode PetscMalloc(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

If you request memory of zero size it will allocate no space and assign the pointer to 0; PetscFree() will properly handle not freeing the null pointer.

See Also

PetscFree(), PetscNew()

Level:beginner
Location:
include/petscsys.h
Index of all Sys routines
Table of Contents for all manual pages
Index of all manual pages

Examples

src/ksp/ksp/examples/tutorials/ex10.c.html
src/ksp/ksp/examples/tutorials/ex42.c.html
src/ksp/ksp/examples/tutorials/ex43.c.html
src/ksp/ksp/examples/tutorials/ex49.c.html
src/snes/examples/tutorials/ex12.c.html
src/snes/examples/tutorials/ex15.c.html
src/snes/examples/tutorials/ex30.c.html
src/snes/examples/tutorials/ex52.c.html
src/snes/examples/tutorials/ex62.c.html
src/ts/examples/tutorials/ex8.c.html
src/ts/examples/tutorials/ex11.c.html