#include <petscsys.h> PetscErrorCode PetscMalloc1(size_t m1,type **r1)Not Collective
Note: This uses the sizeof() of the memory type requested to determine the total memory to be allocated, therefore you should not multiply the number of elements requested by the sizeof() the type. For example use
PetscInt *id;
PetscMalloc1(10,&id);not
PetscInt *id;
PetscMalloc1(10*sizeof(PetscInt),&id);
Does not zero the memory allocatd, used PetscCalloc1() to obtain memory that has been zeroed.
Level:beginner
Location:include/petscsys.h
Index of all Sys routines
Table of Contents for all manual pages
Index of all manual pages