PetscFree#

Frees memory

Synopsis#

#include <petscsys.h>
PetscErrorCode PetscFree(void *memory)

Not Collective

Input Parameter#

  • memory - memory to free (the pointer is ALWAYS set to NULL upon success)

Notes#

Do not free memory obtained with PetscMalloc2(), PetscCalloc2() etc, they must be freed with PetscFree2() etc.

It is safe to call PetscFree() on a NULL pointer.

See Also#

PetscNew(), PetscMalloc(), PetscMalloc1(), PetscCalloc1()

Level#

beginner

Location#

include/petscsys.h

Examples#

src/vec/vec/utils/tagger/tutorials/ex1.c
src/vec/vec/tutorials/ex6.c
src/vec/is/is/tutorials/ex1.c
src/vec/vec/tutorials/ex8.c
src/vec/vec/tutorials/ex9.c
src/sys/classes/random/tutorials/ex1.c
src/sys/tutorials/ex7.c
src/vec/vec/tutorials/ex44.c
src/vec/is/sf/tutorials/ex1.c
src/sys/classes/random/tutorials/ex2.c


Index of all Sys routines
Table of Contents for all manual pages
Index of all manual pages