3 <meta name="generator" content="groff -Thtml, see www.gnu.org">
4 <meta name="Content-Style" content="text/css">
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>
19 <!-- Creator : groff version 1.17.2 -->
20 <!-- CreationDate: Fri May 3 14:57:29 2002 -->
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>
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 <pool.h>
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>
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>
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>
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>
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>
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>
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>
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 <rich@annexia.org></td></table>
98 <a name="LICENSE"></a>
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>
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>