1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML3.2 EN">
<HTML>
<HEAD> <link rel="canonical" href="http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/Sys/PetscMalloc.html" />
<META NAME="GENERATOR" CONTENT="DOCTEXT">
<TITLE>PetscMalloc</TITLE>
</HEAD>
<BODY BGCOLOR="FFFFFF">
<div id="version" align=right><b>petsc-3.4.2 2013-07-02</b></div>
<A NAME="PetscMalloc"><H1>PetscMalloc</H1></A>
Allocates memory
<H3><FONT COLOR="#CC3333">Synopsis</FONT></H3>
<PRE>
#include "petscsys.h"
PetscErrorCode PetscMalloc(size_t m,void **result)
</PRE>
Not Collective
<P>
<H3><FONT COLOR="#CC3333">Input Parameter</FONT></H3>
<DT><B>m </B> -number of bytes to allocate
<br>
<P>
<H3><FONT COLOR="#CC3333">Output Parameter</FONT></H3>
<DT><B>result </B> -memory allocated
<br>
<P>
<P>
Notes: Memory is always allocated at least double aligned
<P>
If you request memory of zero size it will allocate no space and assign the pointer to 0; <A HREF="../Sys/PetscFree.html#PetscFree">PetscFree</A>() will
properly handle not freeing the null pointer.
<P>
<H3><FONT COLOR="#CC3333">See Also</FONT></H3>
<A HREF="../Sys/PetscFree.html#PetscFree">PetscFree</A>(), <A HREF="../Sys/PetscNew.html#PetscNew">PetscNew</A>()
<BR>
<P>
<P>
<P><B><P><B><FONT COLOR="#CC3333">Level:</FONT></B>beginner
<BR><FONT COLOR="#CC3333">Location:</FONT></B><A HREF="../../../include/petscsys.h.html#PetscMalloc">include/petscsys.h</A>
<BR><A HREF="./index.html">Index of all Sys routines</A>
<BR><A HREF="../../index.html">Table of Contents for all manual pages</A>
<BR><A HREF="../singleindex.html">Index of all manual pages</A>
<P><H3><FONT COLOR="#CC3333">Examples</FONT></H3>
<A HREF="../../../src/sys/classes/random/examples/tutorials/ex1.c.html">src/sys/classes/random/examples/tutorials/ex1.c.html</A><BR>
<A HREF="../../../src/sys/threadcomm/examples/tutorials/ex1.c.html">src/sys/threadcomm/examples/tutorials/ex1.c.html</A><BR>
<A HREF="../../../src/sys/threadcomm/examples/tutorials/ex2.c.html">src/sys/threadcomm/examples/tutorials/ex2.c.html</A><BR>
<A HREF="../../../src/sys/threadcomm/examples/tutorials/ex3.c.html">src/sys/threadcomm/examples/tutorials/ex3.c.html</A><BR>
<A HREF="../../../src/sys/threadcomm/examples/tutorials/ex5.c.html">src/sys/threadcomm/examples/tutorials/ex5.c.html</A><BR>
<A HREF="../../../src/vec/vec/examples/tutorials/ex6.c.html">src/vec/vec/examples/tutorials/ex6.c.html</A><BR>
<A HREF="../../../src/vec/vec/examples/tutorials/ex8.c.html">src/vec/vec/examples/tutorials/ex8.c.html</A><BR>
<A HREF="../../../src/vec/vec/examples/tutorials/ex9.c.html">src/vec/vec/examples/tutorials/ex9.c.html</A><BR>
<A HREF="../../../src/vec/is/is/examples/tutorials/ex1.c.html">src/vec/is/is/examples/tutorials/ex1.c.html</A><BR>
<A HREF="../../../src/vec/is/sf/examples/tutorials/ex1.c.html">src/vec/is/sf/examples/tutorials/ex1.c.html</A><BR>
<A HREF="../../../src/mat/examples/tutorials/ex2.c.html">src/mat/examples/tutorials/ex2.c.html</A><BR>
</BODY></HTML>
|