• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1<html>
2<head>
3<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
4<title>Struct default_user_allocator_new_delete</title>
5<link rel="stylesheet" href="../../../../../doc/src/boostbook.css" type="text/css">
6<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
7<link rel="home" href="../index.html" title="Boost.Pool">
8<link rel="up" href="../header/boost/pool/pool_hpp.html" title="Header &lt;boost/pool/pool.hpp&gt;">
9<link rel="prev" href="default_user_allocator_malloc_free.html" title="Struct default_user_allocator_malloc_free">
10<link rel="next" href="../header/boost/pool/pool_alloc_hpp.html" title="Header &lt;boost/pool/pool_alloc.hpp&gt;">
11</head>
12<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
13<table cellpadding="2" width="100%"><tr>
14<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../boost.png"></td>
15<td align="center"><a href="../../../../../index.html">Home</a></td>
16<td align="center"><a href="../../../../../libs/libraries.htm">Libraries</a></td>
17<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
18<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
19<td align="center"><a href="../../../../../more/index.htm">More</a></td>
20</tr></table>
21<hr>
22<div class="spirit-nav">
23<a accesskey="p" href="default_user_allocator_malloc_free.html"><img src="../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../header/boost/pool/pool_hpp.html"><img src="../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="../header/boost/pool/pool_alloc_hpp.html"><img src="../../../../../doc/src/images/next.png" alt="Next"></a>
24</div>
25<div class="refentry">
26<a name="boost.default_user_allocator_new_delete"></a><div class="titlepage"></div>
27<div class="refnamediv">
28<h2><span class="refentrytitle">Struct default_user_allocator_new_delete</span></h2>
29<p>boost::default_user_allocator_new_delete — Allocator used as the default template parameter for a <a href="../boost_pool/pool/pooling.html#boost_pool.pool.pooling.user_allocator" target="_top">UserAllocator</a> template parameter. Uses new and delete. </p>
30</div>
31<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
32<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis"><span class="comment">// In header: &lt;<a class="link" href="../header/boost/pool/pool_hpp.html" title="Header &lt;boost/pool/pool.hpp&gt;">boost/pool/pool.hpp</a>&gt;
33
34</span>
35<span class="keyword">struct</span> <a class="link" href="default_user_allocator_new_delete.html" title="Struct default_user_allocator_new_delete">default_user_allocator_new_delete</a> <span class="special">{</span>
36  <span class="comment">// types</span>
37  <span class="keyword">typedef</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span>    <a name="boost.default_user_allocator_new_delete.size_type"></a><span class="identifier">size_type</span><span class="special">;</span>        <span class="comment">// An unsigned integral type that can represent the size of the largest object to be allocated. </span>
38  <span class="keyword">typedef</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">ptrdiff_t</span> <a name="boost.default_user_allocator_new_delete.difference_type"></a><span class="identifier">difference_type</span><span class="special">;</span>  <span class="comment">// A signed integral type that can represent the difference of any two pointers. </span>
39
40  <span class="comment">// <a class="link" href="default_user_allocator_new_delete.html#idm45810844519472-bb">public static functions</a></span>
41  <span class="keyword">static</span> <span class="keyword">char</span> <span class="special">*</span> <a class="link" href="default_user_allocator_new_delete.html#idm45810844518912-bb"><span class="identifier">malloc</span></a><span class="special">(</span><span class="keyword">const</span> <span class="identifier">size_type</span><span class="special">)</span><span class="special">;</span>
42  <span class="keyword">static</span> <span class="keyword">void</span> <a class="link" href="default_user_allocator_new_delete.html#idm45810844516720-bb"><span class="identifier">free</span></a><span class="special">(</span><span class="keyword">char</span> <span class="special">*</span><span class="keyword">const</span><span class="special">)</span><span class="special">;</span>
43<span class="special">}</span><span class="special">;</span></pre></div>
44<div class="refsect1">
45<a name="idm46412774137344"></a><h2>Description</h2>
46<div class="refsect2">
47<a name="idm46412774136960"></a><h3>
48<a name="idm45810844519472-bb"></a><code class="computeroutput">default_user_allocator_new_delete</code> public static functions</h3>
49<div class="orderedlist"><ol class="orderedlist" type="1">
50<li class="listitem">
51<pre class="literallayout"><span class="keyword">static</span> <span class="keyword">char</span> <span class="special">*</span> <a name="idm45810844518912-bb"></a><span class="identifier">malloc</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">size_type</span> bytes<span class="special">)</span><span class="special">;</span></pre>
52<p>Attempts to allocate n bytes from the system. Returns 0 if out-of-memory </p>
53</li>
54<li class="listitem">
55<pre class="literallayout"><span class="keyword">static</span> <span class="keyword">void</span> <a name="idm45810844516720-bb"></a><span class="identifier">free</span><span class="special">(</span><span class="keyword">char</span> <span class="special">*</span><span class="keyword">const</span> block<span class="special">)</span><span class="special">;</span></pre>
56<p>Attempts to de-allocate block.
57</p>
58<div class="variablelist"><table border="0" class="variablelist compact">
59<colgroup>
60<col align="left" valign="top">
61<col>
62</colgroup>
63<tbody><tr>
64<td><p><span class="term">Requires:</span></p></td>
65<td><p>Block must have been previously returned from a call to UserAllocator::malloc. </p></td>
66</tr></tbody>
67</table></div>
68</li>
69</ol></div>
70</div>
71</div>
72</div>
73<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
74<td align="left"></td>
75<td align="right"><div class="copyright-footer">Copyright © 2000-2006 Stephen Cleary<br>Copyright © 2011 Paul A. Bristow<p>
76        Distributed under the Boost Software License, Version 1.0. (See accompanying
77        file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
78      </p>
79</div></td>
80</tr></table>
81<hr>
82<div class="spirit-nav">
83<a accesskey="p" href="default_user_allocator_malloc_free.html"><img src="../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../header/boost/pool/pool_hpp.html"><img src="../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="../header/boost/pool/pool_alloc_hpp.html"><img src="../../../../../doc/src/images/next.png" alt="Next"></a>
84</div>
85</body>
86</html>
87