PetscMalloc2#

Allocates 2 arrays of memory both aligned to PETSC_MEMALIGN

Synopsis#

#include <petscsys.h>
PetscErrorCode PetscMalloc2(size_t m1,type **r1,size_t m2,type **r2)

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)

Output Parameters#

  • r1 - memory allocated in first chunk

  • r2 - memory allocated in second chunk

See Also#

PetscFree(), PetscNew(), PetscMalloc(), PetscMalloc1(), PetscCalloc2()

Level#

developer

Location#

include/petscsys.h

Examples#

src/ts/tutorials/ex14.c
src/snes/tutorials/ex12.c
src/snes/tutorials/ex7.c
src/snes/tutorials/ex13.c
src/snes/tutorials/ex31.c
src/tao/unconstrained/tutorials/burgers_spectral.c
src/tao/unconstrained/tutorials/spectraladjointassimilation.c
src/vec/is/sf/tutorials/ex1.c
src/snes/tutorials/ex55k.kokkos.cxx
src/vec/vec/tutorials/ex44.c


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