Add to git.
[c2lib.git] / doc / pmalloc.3.html
1 <html>
2 <head>
3 <meta name="generator" content="groff -Thtml, see www.gnu.org">
4 <meta name="Content-Style" content="text/css">
5 <title>pmalloc</title>
6 </head>
7 <body>
8
9 <h1 align=center>pmalloc</h1>
10 <a href="#NAME">NAME</a><br>
11 <a href="#SYNOPSIS">SYNOPSIS</a><br>
12 <a href="#DESCRIPTION">DESCRIPTION</a><br>
13 <a href="#BUGS">BUGS</a><br>
14 <a href="#AUTHOR">AUTHOR</a><br>
15 <a href="#LICENSE">LICENSE</a><br>
16 <a href="#VERSION">VERSION</a><br>
17
18 <hr>
19 <!-- Creator     : groff version 1.17.2 -->
20 <!-- CreationDate: Fri May  3 14:57:29 2002 -->
21 <a name="NAME"></a>
22 <h2>NAME</h2>
23 <table width="100%" border=0 rules="none" frame="void"
24        cols="2" cellspacing="0" cellpadding="0">
25 <tr valign="top" align="left">
26 <td width="10%"></td><td width="90%">
27 pmalloc, pcalloc, prealloc - allocate memory in a pool</td></table>
28 <a name="SYNOPSIS"></a>
29 <h2>SYNOPSIS</h2>
30
31 <table width="100%" border=0 rules="none" frame="void"
32        cols="2" cellspacing="0" cellpadding="0">
33 <tr valign="top" align="left">
34 <td width="10%"></td><td width="90%">
35 <pre><b>#include &lt;pool.h&gt;
36
37 void *pmalloc (pool, size_t n);
38 void *pcalloc (pool, size_t nmemb, size_t size);
39 void *prealloc (pool, void *ptr, size_t n);
40 </b></pre></td></table>
41 <a name="DESCRIPTION"></a>
42 <h2>DESCRIPTION</h2>
43
44 <table width="100%" border=0 rules="none" frame="void"
45        cols="2" cellspacing="0" cellpadding="0">
46 <tr valign="top" align="left">
47 <td width="10%"></td><td width="90%">
48 Allocate memory in a pool or, if pool is null, on the main
49 heap (equivalent to plain <b>malloc</b>). If memory is
50 allocated in a real pool, then it is automatically freed
51 when the pool is deleted.</td></table>
52
53 <table width="100%" border=0 rules="none" frame="void"
54        cols="2" cellspacing="0" cellpadding="0">
55 <tr valign="top" align="left">
56 <td width="10%"></td><td width="90%">
57 Memory returned is word-aligned.</td></table>
58
59 <table width="100%" border=0 rules="none" frame="void"
60        cols="2" cellspacing="0" cellpadding="0">
61 <tr valign="top" align="left">
62 <td width="10%"></td><td width="90%">
63 If a memory allocation fails, the <b>bad_malloc_handler</b>
64 function is called (which defaults to just calling
65 <b>abort(3)</b>).</td></table>
66
67 <table width="100%" border=0 rules="none" frame="void"
68        cols="2" cellspacing="0" cellpadding="0">
69 <tr valign="top" align="left">
70 <td width="10%"></td><td width="90%">
71 <b>pcalloc</b> is identical to <b>pmalloc</b> but also sets
72 the memory to zero before returning it.</td></table>
73
74 <table width="100%" border=0 rules="none" frame="void"
75        cols="2" cellspacing="0" cellpadding="0">
76 <tr valign="top" align="left">
77 <td width="10%"></td><td width="90%">
78 <b>prealloc</b> increases the size of an existing memory
79 allocation. <b>prealloc</b> might move the memory in the
80 process of reallocating it.</td></table>
81 <a name="BUGS"></a>
82 <h2>BUGS</h2>
83
84 <table width="100%" border=0 rules="none" frame="void"
85        cols="2" cellspacing="0" cellpadding="0">
86 <tr valign="top" align="left">
87 <td width="10%"></td><td width="90%">
88 <b>prealloc</b> cannot reduce the size of an existing memory
89 allocation.</td></table>
90 <a name="AUTHOR"></a>
91 <h2>AUTHOR</h2>
92
93 <table width="100%" border=0 rules="none" frame="void"
94        cols="2" cellspacing="0" cellpadding="0">
95 <tr valign="top" align="left">
96 <td width="10%"></td><td width="90%">
97 Richard Jones &lt;rich@annexia.org&gt;</td></table>
98 <a name="LICENSE"></a>
99 <h2>LICENSE</h2>
100
101 <table width="100%" border=0 rules="none" frame="void"
102        cols="2" cellspacing="0" cellpadding="0">
103 <tr valign="top" align="left">
104 <td width="10%"></td><td width="90%">
105 GNU LGPL (see http://www.gnu.org/)</td></table>
106 <a name="VERSION"></a>
107 <h2>VERSION</h2>
108
109 <table width="100%" border=0 rules="none" frame="void"
110        cols="2" cellspacing="0" cellpadding="0">
111 <tr valign="top" align="left">
112 <td width="10%"></td><td width="90%">
113 c2lib-1.2.13</td></table>
114 <hr>
115 </body>
116 </html>