summaryrefslogtreecommitdiff
path: root/doc/html/function/misc.html
diff options
context:
space:
mode:
authorChanho Park <chanho61.park@samsung.com>2014-12-11 18:55:56 +0900
committerChanho Park <chanho61.park@samsung.com>2014-12-11 18:55:56 +0900
commit08c1e93fa36a49f49325a07fe91ff92c964c2b6c (patch)
tree7a7053ceb8874b28ec4b868d4c49b500008a102e /doc/html/function/misc.html
parentbb4dd8289b351fae6b55e303f189127a394a1edd (diff)
downloadboost-08c1e93fa36a49f49325a07fe91ff92c964c2b6c.tar.gz
boost-08c1e93fa36a49f49325a07fe91ff92c964c2b6c.tar.bz2
boost-08c1e93fa36a49f49325a07fe91ff92c964c2b6c.zip
Imported Upstream version 1.57.0upstream/1.57.0
Diffstat (limited to 'doc/html/function/misc.html')
-rw-r--r--doc/html/function/misc.html42
1 files changed, 21 insertions, 21 deletions
diff --git a/doc/html/function/misc.html b/doc/html/function/misc.html
index adce18e499..c456ddf2f8 100644
--- a/doc/html/function/misc.html
+++ b/doc/html/function/misc.html
@@ -3,9 +3,9 @@
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<title>Miscellaneous Notes</title>
<link rel="stylesheet" href="../../../doc/src/boostbook.css" type="text/css">
-<meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
+<meta name="generator" content="DocBook XSL Stylesheets V1.78.1">
<link rel="home" href="../index.html" title="The Boost C++ Libraries BoostBook Documentation Subset">
-<link rel="up" href="../function.html" title="Chapter&#160;9.&#160;Boost.Function">
+<link rel="up" href="../function.html" title="Chapter&#160;11.&#160;Boost.Function">
<link rel="prev" href="faq.html" title="Frequently Asked Questions">
<link rel="next" href="testsuite.html" title="Testsuite">
</head>
@@ -25,19 +25,19 @@
<div class="section">
<div class="titlepage"><div><div><h2 class="title" style="clear: both">
<a name="function.misc"></a>Miscellaneous Notes</h2></div></div></div>
-<div class="toc"><dl>
-<dt><span class="section"><a href="misc.html#id1565241">Boost.Function vs. Function Pointers</a></span></dt>
-<dt><span class="section"><a href="misc.html#id1565307">Performance</a></span></dt>
-<dt><span class="section"><a href="misc.html#id1565381">Combatting virtual function "bloat"</a></span></dt>
-<dt><span class="section"><a href="misc.html#id1565406">Acknowledgements</a></span></dt>
+<div class="toc"><dl class="toc">
+<dt><span class="section"><a href="misc.html#idp210589120">Boost.Function vs. Function Pointers</a></span></dt>
+<dt><span class="section"><a href="misc.html#idp210596304">Performance</a></span></dt>
+<dt><span class="section"><a href="misc.html#idp210603952">Combatting virtual function "bloat"</a></span></dt>
+<dt><span class="section"><a href="misc.html#idp210607472">Acknowledgements</a></span></dt>
</dl></div>
<div class="section">
<div class="titlepage"><div><div><h3 class="title">
-<a name="id1565241"></a>Boost.Function vs. Function Pointers</h3></div></div></div>
+<a name="idp210589120"></a>Boost.Function vs. Function Pointers</h3></div></div></div>
<p>Boost.Function has several advantages over function pointers, namely:
</p>
-<div class="itemizedlist"><ul class="itemizedlist" type="disc" compact>
+<div class="itemizedlist"><ul class="itemizedlist compact" style="list-style-type: disc; ">
<li class="listitem"><p>Boost.Function allows arbitrary compatible function objects to be targets (instead of requiring an exact function signature).</p></li>
<li class="listitem"><p>Boost.Function may be used with argument-binding and other function object construction libraries.</p></li>
<li class="listitem"><p>Boost.Function has predictible behavior when an empty function object is called. </p></li>
@@ -45,7 +45,7 @@
<p> And, of course, function pointers have several advantages over Boost.Function:
</p>
-<div class="itemizedlist"><ul class="itemizedlist" type="disc" compact>
+<div class="itemizedlist"><ul class="itemizedlist compact" style="list-style-type: disc; ">
<li class="listitem"><p> Function pointers are smaller (the size of one pointer instead of four or more) </p></li>
<li class="listitem"><p> Function pointers are faster (Boost.Function may require two calls through function pointers) </p></li>
<li class="listitem"><p> Function pointers are backward-compatible with C libraries.</p></li>
@@ -56,37 +56,37 @@
</div>
<div class="section">
<div class="titlepage"><div><div><h3 class="title">
-<a name="id1565307"></a>Performance</h3></div></div></div>
-<div class="toc"><dl>
-<dt><span class="section"><a href="misc.html#id1565313">Function object wrapper size</a></span></dt>
-<dt><span class="section"><a href="misc.html#id1565336">Copying efficiency</a></span></dt>
-<dt><span class="section"><a href="misc.html#id1565365">Invocation efficiency</a></span></dt>
+<a name="idp210596304"></a>Performance</h3></div></div></div>
+<div class="toc"><dl class="toc">
+<dt><span class="section"><a href="misc.html#idp210596976">Function object wrapper size</a></span></dt>
+<dt><span class="section"><a href="misc.html#idp210599328">Copying efficiency</a></span></dt>
+<dt><span class="section"><a href="misc.html#idp210602336">Invocation efficiency</a></span></dt>
</dl></div>
<div class="section">
<div class="titlepage"><div><div><h4 class="title">
-<a name="id1565313"></a>Function object wrapper size</h4></div></div></div>
+<a name="idp210596976"></a>Function object wrapper size</h4></div></div></div>
<p> Function object wrappers will be the size of a struct containing a member function pointer and two data pointers. The actual size can vary significantly depending on the underlying platform; on 32-bit Mac OS X with GCC, this amounts to 16 bytes, while it is 32 bytes Windows with Visual C++. Additionally, the function object target may be allocated on the heap, if it cannot be placed into the small-object buffer in the <code class="computeroutput">boost::function</code> object.</p>
</div>
<div class="section">
<div class="titlepage"><div><div><h4 class="title">
-<a name="id1565336"></a>Copying efficiency</h4></div></div></div>
+<a name="idp210599328"></a>Copying efficiency</h4></div></div></div>
<p> Copying function object wrappers may require allocating memory for a copy of the function object target. The default allocator may be replaced with a faster custom allocator or one may choose to allow the function object wrappers to only store function object targets by reference (using <code class="computeroutput">ref</code>) if the cost of this cloning becomes prohibitive. Small function objects can be stored within the <code class="computeroutput">boost::function</code> object itself, improving copying efficiency.</p>
</div>
<div class="section">
<div class="titlepage"><div><div><h4 class="title">
-<a name="id1565365"></a>Invocation efficiency</h4></div></div></div>
+<a name="idp210602336"></a>Invocation efficiency</h4></div></div></div>
<p> With a properly inlining compiler, an invocation of a function object requires one call through a function pointer. If the call is to a free function pointer, an additional call must be made to that function pointer (unless the compiler has very powerful interprocedural analysis).</p>
</div>
</div>
<div class="section">
<div class="titlepage"><div><div><h3 class="title">
-<a name="id1565381"></a>Combatting virtual function "bloat"</h3></div></div></div>
+<a name="idp210603952"></a>Combatting virtual function "bloat"</h3></div></div></div>
<p> The use of virtual functions tends to cause 'code bloat' on many compilers. When a class contains a virtual function, it is necessary to emit an additional function that classifies the type of the object. It has been our experience that these auxiliary functions increase the size of the executable significantly when many <code class="computeroutput">boost::function</code> objects are used. </p>
<p> In Boost.Function, an alternative but equivalent approach was taken using free functions instead of virtual functions. The Boost.Function object essentially holds two pointers to make a valid target call: a void pointer to the function object it contains and a void pointer to an "invoker" that can call the function object, given the function pointer. This invoker function performs the argument and return value conversions Boost.Function provides. A third pointer points to a free function called the "manager", which handles the cloning and destruction of function objects. The scheme is typesafe because the only functions that actually handle the function object, the invoker and the manager, are instantiated given the type of the function object, so they can safely cast the incoming void pointer (the function object pointer) to the appropriate type.</p>
</div>
<div class="section">
<div class="titlepage"><div><div><h3 class="title">
-<a name="id1565406"></a>Acknowledgements</h3></div></div></div>
+<a name="idp210607472"></a>Acknowledgements</h3></div></div></div>
<p> Many people were involved in the construction of this
library. William Kempf, Jesse Jones and Karl Nelson were all
extremely helpful in isolating an interface and scope for the
@@ -97,7 +97,7 @@
</div>
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
-<td align="left"><p><small>Last revised: July 14, 2008 at 19:32:29 +0100</small></p></td>
+<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright &#169; 2001-2004 Douglas Gregor<p>Use, modification and distribution is subject to the Boost
Software License, Version 1.0. (See accompanying file
<code class="filename">LICENSE_1_0.txt</code> or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)</p>