Commit 544be2be by Jonathan Wakely Committed by Jonathan Wakely

Remove Profile Mode, deprecated since GCC 7.1

The Profile Mode extension is not used by anybody, nor maintained by
anybody. The containers do not support the full API specified in recent
standards, and so enabling Profile Mode is not source compatible with
much modern C++ code. The heuristics that would check the profile
information and make useful suggestions never materialized, so it isn't
useful.

It should be removed.

	Remove Profile Mode, deprecated since 7.1.0
	* doc/Makefile.am: Remove XML file for profile mode docs.
	* doc/Makefile.in: Regenerate.
	* doc/xml/authors.xml: Remove authors of profile mode docs.
	* doc/xml/manual/appendix_contributing.xml: Remove mention of profile
	mode.
	* doc/xml/manual/debug.xml: Likewise.
	* doc/xml/manual/evolution.xml: Document removal of profile mode.
	* doc/xml/manual/profile_mode.xml: Remove profile mode docs.
	* doc/xml/manual/spine.xml: Remove profile mode author credit.
	* doc/xml/manual/test.xml: Remove docs for dg-require-profile-mode
	directive.
	* doc/xml/manual/using.xml: Remove docs for profile mode headers and
	macro.
	* doc/html/*: Regenerate.
	* include/Makefile.am: Remove profile mode headers.
	* include/Makefile.in: Regenerate.
	* include/bits/c++config (std::__profile): Remove namespace.
	[_GLIBCXX_PROFILE]: Remove checks for macro.
	* include/profile/array: Remove.
	* include/profile/base.h: Remove.
	* include/profile/bitset: Remove.
	* include/profile/deque: Remove.
	* include/profile/forward_list: Remove.
	* include/profile/impl/profiler.h: Remove.
	* include/profile/impl/profiler_algos.h: Remove.
	* include/profile/impl/profiler_container_size.h: Remove.
	* include/profile/impl/profiler_hash_func.h: Remove.
	* include/profile/impl/profiler_hashtable_size.h: Remove.
	* include/profile/impl/profiler_list_to_slist.h: Remove.
	* include/profile/impl/profiler_list_to_vector.h: Remove.
	* include/profile/impl/profiler_map_to_unordered_map.h: Remove.
	* include/profile/impl/profiler_node.h: Remove.
	* include/profile/impl/profiler_state.h: Remove.
	* include/profile/impl/profiler_trace.h: Remove.
	* include/profile/impl/profiler_vector_size.h: Remove.
	* include/profile/impl/profiler_vector_to_list.h: Remove.
	* include/profile/iterator_tracker.h: Remove.
	* include/profile/list: Remove.
	* include/profile/map: Remove.
	* include/profile/map.h: Remove.
	* include/profile/multimap.h: Remove.
	* include/profile/multiset.h: Remove.
	* include/profile/ordered_base.h: Remove.
	* include/profile/set: Remove.
	* include/profile/set.h: Remove.
	* include/profile/unordered_base.h: Remove.
	* include/profile/unordered_map: Remove.
	* include/profile/unordered_set: Remove.
	* include/profile/vector: Remove.
	* scripts/run_doxygen: Do not process profile mode headers.
	* testsuite/23_containers/array/element_access/60497.cc: Don't use
	profile mode type.
	* testsuite/23_containers/array/specialized_algorithms/swap_cxx17.cc:
	Remove dg-skip-if for profile mode.
	* testsuite/23_containers/forward_list/capacity/1.cc: Remove
	preprocessor check for profile mode.
	* testsuite/23_containers/list/capacity/29134.cc: Likewise.
	* testsuite/23_containers/map/modifiers/extract.cc: Remove dg-skip-if
	for profile mode.
	* testsuite/23_containers/map/modifiers/insert_or_assign/1.cc:
	Likewise.
	* testsuite/23_containers/map/modifiers/try_emplace/1.cc: Likewise.
	* testsuite/23_containers/multimap/modifiers/extract.cc: Likewise.
	* testsuite/23_containers/multiset/modifiers/extract.cc: Likewise.
	* testsuite/23_containers/set/modifiers/extract.cc: Likewise.
	* testsuite/23_containers/unordered_map/modifiers/extract.cc:
	Likewise.
	* testsuite/23_containers/unordered_multimap/modifiers/extract.cc:
	Likewise.
	* testsuite/23_containers/unordered_multiset/modifiers/extract.cc:
	Likewise.
	* testsuite/23_containers/unordered_set/modifiers/extract.cc:
	Likewise.
	* testsuite/23_containers/vector/bool/capacity/29134.cc: Remove
	preprocessor check for profile mode.
	* testsuite/23_containers/vector/bool/modifiers/insert/31370.cc:
	Likewise.
	* testsuite/23_containers/vector/modifiers/insert_vs_emplace.cc:
	Remove dg-skip-if for profile mode.
	* testsuite/25_algorithms/binary_search/partitioned.cc: Likewise.
	* testsuite/25_algorithms/equal_range/partitioned.cc: Likewise.
	* testsuite/25_algorithms/lexicographical_compare/71545.cc: Likewise.
	* testsuite/25_algorithms/lower_bound/partitioned.cc: Likewise.
	* testsuite/25_algorithms/upper_bound/partitioned.cc: Likewise.
	* testsuite/Makefile.am: Remove profile_flags variable and
	* testsuite/Makefile.am: Remove profile_flags variable and
	check-profile target.
	* testsuite/Makefile.in: Regenerate.
	* testsuite/ext/profile/all.cc: Remove.
	* testsuite/ext/profile/mutex_extensions_neg.cc: Remove.
	* testsuite/ext/profile/profiler_algos.cc: Remove.
	* testsuite/ext/profile/replace_new.cc: Remove.
	* testsuite/ext/throw_allocator/deallocate_global.cc: Remove
	preprocessor check for profile mode.
	* testsuite/ext/throw_allocator/deallocate_local.cc: Likewise.
	* testsuite/lib/libstdc++.exp (check_v3_target_profile_mode): Remove.
	(check_v3_target_normal_mode): Do not check for profile mode macro.
	* testsuite/libstdc++-prettyprinters/80276.cc: Remove dg-skip-if for
	profile mode.
	* testsuite/libstdc++-prettyprinters/compat.cc: Likewise.
	* testsuite/libstdc++-prettyprinters/cxx11.cc: Likewise.
	* testsuite/libstdc++-prettyprinters/cxx17.cc: Likewise.
	* testsuite/libstdc++-prettyprinters/debug.cc: Likewise.
	* testsuite/libstdc++-prettyprinters/debug_cxx11.cc: Likewise.
	* testsuite/libstdc++-prettyprinters/libfundts.cc: Likewise.
	* testsuite/libstdc++-prettyprinters/simple.cc: Likewise.
	* testsuite/libstdc++-prettyprinters/simple11.cc: Likewise.
	* testsuite/libstdc++-prettyprinters/whatis.cc: Likewise.
	* testsuite/libstdc++-prettyprinters/whatis2.cc: Likewise.

From-SVN: r271120
parent 0d09ca25
2019-05-11 Jonathan Wakely <jwakely@redhat.com> 2019-05-11 Jonathan Wakely <jwakely@redhat.com>
Remove Profile Mode, deprecated since 7.1.0
* doc/Makefile.am: Remove XML file for profile mode docs.
* doc/Makefile.in: Regenerate.
* doc/xml/authors.xml: Remove authors of profile mode docs.
* doc/xml/manual/appendix_contributing.xml: Remove mention of profile
mode.
* doc/xml/manual/debug.xml: Likewise.
* doc/xml/manual/evolution.xml: Document removal of profile mode.
* doc/xml/manual/profile_mode.xml: Remove profile mode docs.
* doc/xml/manual/spine.xml: Remove profile mode author credit.
* doc/xml/manual/test.xml: Remove docs for dg-require-profile-mode
directive.
* doc/xml/manual/using.xml: Remove docs for profile mode headers and
macro.
* doc/html/*: Regenerate.
* include/Makefile.am: Remove profile mode headers.
* include/Makefile.in: Regenerate.
* include/bits/c++config (std::__profile): Remove namespace.
[_GLIBCXX_PROFILE]: Remove checks for macro.
* include/profile/array: Remove.
* include/profile/base.h: Remove.
* include/profile/bitset: Remove.
* include/profile/deque: Remove.
* include/profile/forward_list: Remove.
* include/profile/impl/profiler.h: Remove.
* include/profile/impl/profiler_algos.h: Remove.
* include/profile/impl/profiler_container_size.h: Remove.
* include/profile/impl/profiler_hash_func.h: Remove.
* include/profile/impl/profiler_hashtable_size.h: Remove.
* include/profile/impl/profiler_list_to_slist.h: Remove.
* include/profile/impl/profiler_list_to_vector.h: Remove.
* include/profile/impl/profiler_map_to_unordered_map.h: Remove.
* include/profile/impl/profiler_node.h: Remove.
* include/profile/impl/profiler_state.h: Remove.
* include/profile/impl/profiler_trace.h: Remove.
* include/profile/impl/profiler_vector_size.h: Remove.
* include/profile/impl/profiler_vector_to_list.h: Remove.
* include/profile/iterator_tracker.h: Remove.
* include/profile/list: Remove.
* include/profile/map: Remove.
* include/profile/map.h: Remove.
* include/profile/multimap.h: Remove.
* include/profile/multiset.h: Remove.
* include/profile/ordered_base.h: Remove.
* include/profile/set: Remove.
* include/profile/set.h: Remove.
* include/profile/unordered_base.h: Remove.
* include/profile/unordered_map: Remove.
* include/profile/unordered_set: Remove.
* include/profile/vector: Remove.
* scripts/run_doxygen: Do not process profile mode headers.
* testsuite/23_containers/array/element_access/60497.cc: Don't use
profile mode type.
* testsuite/23_containers/array/specialized_algorithms/swap_cxx17.cc:
Remove dg-skip-if for profile mode.
* testsuite/23_containers/forward_list/capacity/1.cc: Remove
preprocessor check for profile mode.
* testsuite/23_containers/list/capacity/29134.cc: Likewise.
* testsuite/23_containers/map/modifiers/extract.cc: Remove dg-skip-if
for profile mode.
* testsuite/23_containers/map/modifiers/insert_or_assign/1.cc:
Likewise.
* testsuite/23_containers/map/modifiers/try_emplace/1.cc: Likewise.
* testsuite/23_containers/multimap/modifiers/extract.cc: Likewise.
* testsuite/23_containers/multiset/modifiers/extract.cc: Likewise.
* testsuite/23_containers/set/modifiers/extract.cc: Likewise.
* testsuite/23_containers/unordered_map/modifiers/extract.cc:
Likewise.
* testsuite/23_containers/unordered_multimap/modifiers/extract.cc:
Likewise.
* testsuite/23_containers/unordered_multiset/modifiers/extract.cc:
Likewise.
* testsuite/23_containers/unordered_set/modifiers/extract.cc:
Likewise.
* testsuite/23_containers/vector/bool/capacity/29134.cc: Remove
preprocessor check for profile mode.
* testsuite/23_containers/vector/bool/modifiers/insert/31370.cc:
Likewise.
* testsuite/23_containers/vector/modifiers/insert_vs_emplace.cc:
Remove dg-skip-if for profile mode.
* testsuite/25_algorithms/binary_search/partitioned.cc: Likewise.
* testsuite/25_algorithms/equal_range/partitioned.cc: Likewise.
* testsuite/25_algorithms/lexicographical_compare/71545.cc: Likewise.
* testsuite/25_algorithms/lower_bound/partitioned.cc: Likewise.
* testsuite/25_algorithms/upper_bound/partitioned.cc: Likewise.
* testsuite/Makefile.am: Remove profile_flags variable and
* testsuite/Makefile.am: Remove profile_flags variable and
check-profile target.
* testsuite/Makefile.in: Regenerate.
* testsuite/ext/profile/all.cc: Remove.
* testsuite/ext/profile/mutex_extensions_neg.cc: Remove.
* testsuite/ext/profile/profiler_algos.cc: Remove.
* testsuite/ext/profile/replace_new.cc: Remove.
* testsuite/ext/throw_allocator/deallocate_global.cc: Remove
preprocessor check for profile mode.
* testsuite/ext/throw_allocator/deallocate_local.cc: Likewise.
* testsuite/lib/libstdc++.exp (check_v3_target_profile_mode): Remove.
(check_v3_target_normal_mode): Do not check for profile mode macro.
* testsuite/libstdc++-prettyprinters/80276.cc: Remove dg-skip-if for
profile mode.
* testsuite/libstdc++-prettyprinters/compat.cc: Likewise.
* testsuite/libstdc++-prettyprinters/cxx11.cc: Likewise.
* testsuite/libstdc++-prettyprinters/cxx17.cc: Likewise.
* testsuite/libstdc++-prettyprinters/debug.cc: Likewise.
* testsuite/libstdc++-prettyprinters/debug_cxx11.cc: Likewise.
* testsuite/libstdc++-prettyprinters/libfundts.cc: Likewise.
* testsuite/libstdc++-prettyprinters/simple.cc: Likewise.
* testsuite/libstdc++-prettyprinters/simple11.cc: Likewise.
* testsuite/libstdc++-prettyprinters/whatis.cc: Likewise.
* testsuite/libstdc++-prettyprinters/whatis2.cc: Likewise.
Remove array_allocator extension, deprecated since 4.9.0 Remove array_allocator extension, deprecated since 4.9.0
* doc/xml/manual/allocator.xml: Remove documentation for * doc/xml/manual/allocator.xml: Remove documentation for
array_allocator. array_allocator.
......
...@@ -336,7 +336,6 @@ xml_sources_manual = \ ...@@ -336,7 +336,6 @@ xml_sources_manual = \
${xml_dir}/manual/policy_data_structures.xml \ ${xml_dir}/manual/policy_data_structures.xml \
${xml_dir}/manual/policy_data_structures_biblio.xml \ ${xml_dir}/manual/policy_data_structures_biblio.xml \
${xml_dir}/manual/prerequisites.xml \ ${xml_dir}/manual/prerequisites.xml \
${xml_dir}/manual/profile_mode.xml \
${xml_dir}/manual/shared_ptr.xml \ ${xml_dir}/manual/shared_ptr.xml \
${xml_dir}/manual/spine.xml \ ${xml_dir}/manual/spine.xml \
${xml_dir}/manual/status_cxx1998.xml \ ${xml_dir}/manual/status_cxx1998.xml \
......
...@@ -477,7 +477,6 @@ xml_sources_manual = \ ...@@ -477,7 +477,6 @@ xml_sources_manual = \
${xml_dir}/manual/policy_data_structures.xml \ ${xml_dir}/manual/policy_data_structures.xml \
${xml_dir}/manual/policy_data_structures_biblio.xml \ ${xml_dir}/manual/policy_data_structures_biblio.xml \
${xml_dir}/manual/prerequisites.xml \ ${xml_dir}/manual/prerequisites.xml \
${xml_dir}/manual/profile_mode.xml \
${xml_dir}/manual/shared_ptr.xml \ ${xml_dir}/manual/shared_ptr.xml \
${xml_dir}/manual/spine.xml \ ${xml_dir}/manual/spine.xml \
${xml_dir}/manual/status_cxx1998.xml \ ${xml_dir}/manual/status_cxx1998.xml \
......
...@@ -34,7 +34,7 @@ Removal of <code class="filename">&lt;ext/tree&gt;</code>, moved to <code class= ...@@ -34,7 +34,7 @@ Removal of <code class="filename">&lt;ext/tree&gt;</code>, moved to <code class=
GCC 3.4 onwards the default allocator uses <code class="code">new</code> anyway, GCC 3.4 onwards the default allocator uses <code class="code">new</code> anyway,
but for the optional pooling allocators the functionality is enabled by but for the optional pooling allocators the functionality is enabled by
setting <code class="literal">GLIBCXX_FORCE_NEW</code> in the environment, see setting <code class="literal">GLIBCXX_FORCE_NEW</code> in the environment, see
<a class="link" href="mt_allocator.html" title="Chapter 20. The mt_allocator">the mt allocator chapter</a> <a class="link" href="mt_allocator.html" title="Chapter 19. The mt_allocator">the mt allocator chapter</a>
for details. for details.
</p><p>Error handling in iostreams cleaned up, made consistent. </p></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="api.rel_330"></a><code class="constant">3.3</code></h3></div></div></div><p> </p><p>Error handling in iostreams cleaned up, made consistent. </p></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="api.rel_330"></a><code class="constant">3.3</code></h3></div></div></div><p>
</p></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="api.rel_340"></a><code class="constant">3.4</code></h3></div></div></div><p> </p></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="api.rel_340"></a><code class="constant">3.4</code></h3></div></div></div><p>
...@@ -391,4 +391,6 @@ now defaults to zero. ...@@ -391,4 +391,6 @@ now defaults to zero.
<code class="filename">&lt;experimental/socket&gt;</code>, <code class="filename">&lt;experimental/socket&gt;</code>,
and and
<code class="filename">&lt;experimental/timer&gt;</code>. <code class="filename">&lt;experimental/timer&gt;</code>.
</p></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="api.rel_101"></a><code class="constant">10</code></h3></div></div></div><p> Deprecated features removed:
</p><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"> Profile Mode </li><li class="listitem"><code class="classname">__gnu_cxx::array_allocator</code></li></ul></div><p>
</p></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="abi.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="appendix_porting.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="backwards.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">ABI Policy and Guidelines </td><td width="20%" align="center"><a accesskey="h" href="../index.html">Home</a></td><td width="40%" align="right" valign="top"> Backwards Compatibility</td></tr></table></div></body></html> </p></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="abi.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="appendix_porting.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="backwards.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">ABI Policy and Guidelines </td><td width="20%" align="center"><a accesskey="h" href="../index.html">Home</a></td><td width="40%" align="right" valign="top"> Backwards Compatibility</td></tr></table></div></body></html>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Chapter 21. The bitmap_allocator</title><meta name="generator" content="DocBook XSL Stylesheets Vsnapshot" /><meta name="keywords" content="ISO C++, allocator" /><meta name="keywords" content="ISO C++, library" /><meta name="keywords" content="ISO C++, runtime, library" /><link rel="home" href="../index.html" title="The GNU C++ Library" /><link rel="up" href="extensions.html" title="Part III.  Extensions" /><link rel="prev" href="mt_allocator_ex_multi.html" title="Multiple Thread Example" /><link rel="next" href="bitmap_allocator_impl.html" title="Implementation" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 21. The bitmap_allocator</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="mt_allocator_ex_multi.html">Prev</a> </td><th width="60%" align="center">Part III.  <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Chapter 20. The bitmap_allocator</title><meta name="generator" content="DocBook XSL Stylesheets Vsnapshot" /><meta name="keywords" content="ISO C++, allocator" /><meta name="keywords" content="ISO C++, library" /><meta name="keywords" content="ISO C++, runtime, library" /><link rel="home" href="../index.html" title="The GNU C++ Library" /><link rel="up" href="extensions.html" title="Part III.  Extensions" /><link rel="prev" href="mt_allocator_ex_multi.html" title="Multiple Thread Example" /><link rel="next" href="bitmap_allocator_impl.html" title="Implementation" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 20. The bitmap_allocator</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="mt_allocator_ex_multi.html">Prev</a> </td><th width="60%" align="center">Part III. 
Extensions Extensions
</th><td width="20%" align="right"> <a accesskey="n" href="bitmap_allocator_impl.html">Next</a></td></tr></table><hr /></div><div class="chapter"><div class="titlepage"><div><div><h2 class="title"><a id="manual.ext.allocator.bitmap"></a>Chapter 21. The bitmap_allocator</h2></div></div></div><div class="toc"><p><strong>Table of Contents</strong></p><dl class="toc"><dt><span class="section"><a href="bitmap_allocator.html#allocator.bitmap.design">Design</a></span></dt><dt><span class="section"><a href="bitmap_allocator_impl.html">Implementation</a></span></dt><dd><dl><dt><span class="section"><a href="bitmap_allocator_impl.html#bitmap.impl.free_list_store">Free List Store</a></span></dt><dt><span class="section"><a href="bitmap_allocator_impl.html#bitmap.impl.super_block">Super Block</a></span></dt><dt><span class="section"><a href="bitmap_allocator_impl.html#bitmap.impl.super_block_data">Super Block Data Layout</a></span></dt><dt><span class="section"><a href="bitmap_allocator_impl.html#bitmap.impl.max_wasted">Maximum Wasted Percentage</a></span></dt><dt><span class="section"><a href="bitmap_allocator_impl.html#bitmap.impl.allocate"><code class="function">allocate</code></a></span></dt><dt><span class="section"><a href="bitmap_allocator_impl.html#bitmap.impl.deallocate"><code class="function">deallocate</code></a></span></dt><dt><span class="section"><a href="bitmap_allocator_impl.html#bitmap.impl.questions">Questions</a></span></dt><dd><dl><dt><span class="section"><a href="bitmap_allocator_impl.html#bitmap.impl.question.1">1</a></span></dt><dt><span class="section"><a href="bitmap_allocator_impl.html#bitmap.impl.question.2">2</a></span></dt><dt><span class="section"><a href="bitmap_allocator_impl.html#bitmap.impl.question.3">3</a></span></dt></dl></dd><dt><span class="section"><a href="bitmap_allocator_impl.html#bitmap.impl.locality">Locality</a></span></dt><dt><span class="section"><a href="bitmap_allocator_impl.html#bitmap.impl.grow_policy">Overhead and Grow Policy</a></span></dt></dl></dd></dl></div><p> </th><td width="20%" align="right"> <a accesskey="n" href="bitmap_allocator_impl.html">Next</a></td></tr></table><hr /></div><div class="chapter"><div class="titlepage"><div><div><h2 class="title"><a id="manual.ext.allocator.bitmap"></a>Chapter 20. The bitmap_allocator</h2></div></div></div><div class="toc"><p><strong>Table of Contents</strong></p><dl class="toc"><dt><span class="section"><a href="bitmap_allocator.html#allocator.bitmap.design">Design</a></span></dt><dt><span class="section"><a href="bitmap_allocator_impl.html">Implementation</a></span></dt><dd><dl><dt><span class="section"><a href="bitmap_allocator_impl.html#bitmap.impl.free_list_store">Free List Store</a></span></dt><dt><span class="section"><a href="bitmap_allocator_impl.html#bitmap.impl.super_block">Super Block</a></span></dt><dt><span class="section"><a href="bitmap_allocator_impl.html#bitmap.impl.super_block_data">Super Block Data Layout</a></span></dt><dt><span class="section"><a href="bitmap_allocator_impl.html#bitmap.impl.max_wasted">Maximum Wasted Percentage</a></span></dt><dt><span class="section"><a href="bitmap_allocator_impl.html#bitmap.impl.allocate"><code class="function">allocate</code></a></span></dt><dt><span class="section"><a href="bitmap_allocator_impl.html#bitmap.impl.deallocate"><code class="function">deallocate</code></a></span></dt><dt><span class="section"><a href="bitmap_allocator_impl.html#bitmap.impl.questions">Questions</a></span></dt><dd><dl><dt><span class="section"><a href="bitmap_allocator_impl.html#bitmap.impl.question.1">1</a></span></dt><dt><span class="section"><a href="bitmap_allocator_impl.html#bitmap.impl.question.2">2</a></span></dt><dt><span class="section"><a href="bitmap_allocator_impl.html#bitmap.impl.question.3">3</a></span></dt></dl></dd><dt><span class="section"><a href="bitmap_allocator_impl.html#bitmap.impl.locality">Locality</a></span></dt><dt><span class="section"><a href="bitmap_allocator_impl.html#bitmap.impl.grow_policy">Overhead and Grow Policy</a></span></dt></dl></dd></dl></div><p>
</p><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="allocator.bitmap.design"></a>Design</h2></div></div></div><p> </p><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="allocator.bitmap.design"></a>Design</h2></div></div></div><p>
As this name suggests, this allocator uses a bit-map to keep track As this name suggests, this allocator uses a bit-map to keep track
of the used and unused memory locations for its book-keeping of the used and unused memory locations for its book-keeping
......
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Implementation</title><meta name="generator" content="DocBook XSL Stylesheets Vsnapshot" /><meta name="keywords" content="ISO C++, allocator" /><meta name="keywords" content="ISO C++, library" /><meta name="keywords" content="ISO C++, runtime, library" /><link rel="home" href="../index.html" title="The GNU C++ Library" /><link rel="up" href="bitmap_allocator.html" title="Chapter 21. The bitmap_allocator" /><link rel="prev" href="bitmap_allocator.html" title="Chapter 21. The bitmap_allocator" /><link rel="next" href="policy_data_structures.html" title="Chapter 22. Policy-Based Data Structures" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Implementation</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="bitmap_allocator.html">Prev</a> </td><th width="60%" align="center">Chapter 21. The bitmap_allocator</th><td width="20%" align="right"> <a accesskey="n" href="policy_data_structures.html">Next</a></td></tr></table><hr /></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="allocator.bitmap.impl"></a>Implementation</h2></div></div></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="bitmap.impl.free_list_store"></a>Free List Store</h3></div></div></div><p> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Implementation</title><meta name="generator" content="DocBook XSL Stylesheets Vsnapshot" /><meta name="keywords" content="ISO C++, allocator" /><meta name="keywords" content="ISO C++, library" /><meta name="keywords" content="ISO C++, runtime, library" /><link rel="home" href="../index.html" title="The GNU C++ Library" /><link rel="up" href="bitmap_allocator.html" title="Chapter 20. The bitmap_allocator" /><link rel="prev" href="bitmap_allocator.html" title="Chapter 20. The bitmap_allocator" /><link rel="next" href="policy_data_structures.html" title="Chapter 21. Policy-Based Data Structures" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Implementation</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="bitmap_allocator.html">Prev</a> </td><th width="60%" align="center">Chapter 20. The bitmap_allocator</th><td width="20%" align="right"> <a accesskey="n" href="policy_data_structures.html">Next</a></td></tr></table><hr /></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="allocator.bitmap.impl"></a>Implementation</h2></div></div></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="bitmap.impl.free_list_store"></a>Free List Store</h3></div></div></div><p>
The Free List Store (referred to as FLS for the remaining part of this The Free List Store (referred to as FLS for the remaining part of this
document) is the Global memory pool that is shared by all instances of document) is the Global memory pool that is shared by all instances of
the bitmapped allocator instantiated for any type. This maintains a the bitmapped allocator instantiated for any type. This maintains a
...@@ -75,7 +75,7 @@ else return false.</p></li></ol></div><p> ...@@ -75,7 +75,7 @@ else return false.</p></li></ol></div><p>
</p><p> </p><p>
Consider a block of size 64 ints. In memory, it would look like this: Consider a block of size 64 ints. In memory, it would look like this:
(assume a 32-bit system where, size_t is a 32-bit entity). (assume a 32-bit system where, size_t is a 32-bit entity).
</p><div class="table"><a id="table.bitmap_alloc"></a><p class="title"><strong>Table 21.1. Bitmap Allocator Memory Map</strong></p><div class="table-contents"><table class="table" summary="Bitmap Allocator Memory Map" border="1"><colgroup><col align="left" class="c1" /><col align="left" class="c2" /><col align="left" class="c3" /><col align="left" class="c4" /><col align="left" class="c5" /></colgroup><tbody><tr><td align="left">268</td><td align="left">0</td><td align="left">4294967295</td><td align="left">4294967295</td><td align="left">Data -&gt; Space for 64 ints</td></tr></tbody></table></div></div><br class="table-break" /><p> </p><div class="table"><a id="table.bitmap_alloc"></a><p class="title"><strong>Table 20.1. Bitmap Allocator Memory Map</strong></p><div class="table-contents"><table class="table" summary="Bitmap Allocator Memory Map" border="1"><colgroup><col align="left" class="c1" /><col align="left" class="c2" /><col align="left" class="c3" /><col align="left" class="c4" /><col align="left" class="c5" /></colgroup><tbody><tr><td align="left">268</td><td align="left">0</td><td align="left">4294967295</td><td align="left">4294967295</td><td align="left">Data -&gt; Space for 64 ints</td></tr></tbody></table></div></div><br class="table-break" /><p>
The first Column(268) represents the size of the Block in bytes as The first Column(268) represents the size of the Block in bytes as
seen by the Bitmap Allocator. Internally, a global free list is seen by the Bitmap Allocator. Internally, a global free list is
used to keep track of the free blocks used and given back by the used to keep track of the free blocks used and given back by the
...@@ -309,4 +309,4 @@ equivalent.</p></li><li class="listitem"><p>And also this would preserve the cac ...@@ -309,4 +309,4 @@ equivalent.</p></li><li class="listitem"><p>And also this would preserve the cac
sizeof(size_t) x 8 which is the number of bits in an integer, sizeof(size_t) x 8 which is the number of bits in an integer,
which can fit exactly in a CPU register. Hence, the term given is which can fit exactly in a CPU register. Hence, the term given is
exponential growth of the internal pool. exponential growth of the internal pool.
</p></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="bitmap_allocator.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="bitmap_allocator.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="policy_data_structures.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Chapter 21. The bitmap_allocator </td><td width="20%" align="center"><a accesskey="h" href="../index.html">Home</a></td><td width="40%" align="right" valign="top"> Chapter 22. Policy-Based Data Structures</td></tr></table></div></body></html> </p></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="bitmap_allocator.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="bitmap_allocator.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="policy_data_structures.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Chapter 20. The bitmap_allocator </td><td width="20%" align="center"><a accesskey="h" href="../index.html">Home</a></td><td width="40%" align="right" valign="top"> Chapter 21. Policy-Based Data Structures</td></tr></table></div></body></html>
\ No newline at end of file \ No newline at end of file
...@@ -458,6 +458,14 @@ ...@@ -458,6 +458,14 @@
should neither be constrained nor <code class="code">explicit</code> should neither be constrained nor <code class="code">explicit</code>
</em></span> </em></span>
</span></dt><dd><p>Remove <code class="code">explicit</code> from the constructor. </span></dt><dd><p>Remove <code class="code">explicit</code> from the constructor.
</p></dd><dt><a id="manual.bugs.dr2408"></a><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2408" target="_top">2408</a>:
<span class="emphasis"><em>SFINAE-friendly
<code class="code">common_type</code>/<code class="code">iterator_traits</code>
is missing in C++14
</em></span>
</span></dt><dd><p>Make <code class="code">iterator_traits</code> empty if any of the
types is not present in the iterator.
Make <code class="code">common_type&lt;&gt;</code> empty.
</p></dd><dt><a id="manual.bugs.dr2415"></a><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2415" target="_top">2415</a>: </p></dd><dt><a id="manual.bugs.dr2415"></a><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2415" target="_top">2415</a>:
<span class="emphasis"><em>Inconsistency between <code class="code">unique_ptr</code> and <code class="code">shared_ptr</code></em></span> <span class="emphasis"><em>Inconsistency between <code class="code">unique_ptr</code> and <code class="code">shared_ptr</code></em></span>
</span></dt><dd><p>Create empty an <code class="code">shared_ptr</code> from an empty </span></dt><dd><p>Create empty an <code class="code">shared_ptr</code> from an empty
...@@ -491,6 +499,12 @@ ...@@ -491,6 +499,12 @@
<span class="emphasis"><em><code class="code">std::polar</code> should require a non-negative rho <span class="emphasis"><em><code class="code">std::polar</code> should require a non-negative rho
</em></span> </em></span>
</span></dt><dd><p>Add debug mode assertion. </span></dt><dd><p>Add debug mode assertion.
</p></dd><dt><a id="manual.bugs.dr2465"></a><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2465" target="_top">2465</a>:
<span class="emphasis"><em>SFINAE-friendly <code class="code">common_type</code> is nearly impossible
to specialize correctly and regresses key functionality
</em></span>
</span></dt><dd><p>Detect whether <code class="code">decay_t</code> changes either type
and use the decayed types if so.
</p></dd><dt><a id="manual.bugs.dr2466"></a><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2466" target="_top">2466</a>: </p></dd><dt><a id="manual.bugs.dr2466"></a><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2466" target="_top">2466</a>:
<span class="emphasis"><em><code class="code">allocator_traits::max_size()</code> default behavior is incorrect <span class="emphasis"><em><code class="code">allocator_traits::max_size()</code> default behavior is incorrect
</em></span> </em></span>
...@@ -501,14 +515,14 @@ ...@@ -501,14 +515,14 @@
</span></dt><dd><p>Avoid using <code class="code">dynamic_cast</code> when it would be </span></dt><dd><p>Avoid using <code class="code">dynamic_cast</code> when it would be
ill-formed. ill-formed.
</p></dd><dt><a id="manual.bugs.dr2537"></a><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2537" target="_top">2537</a>: </p></dd><dt><a id="manual.bugs.dr2537"></a><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2537" target="_top">2537</a>:
<span class="emphasis"><em>Requirements on the first template parameter of container adaptors
</em></span>
</span></dt><dd><p>Add static assertions to enforce the requirement.
</p></dd><dt><a id="manual.bugs.dr2566"></a><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2566" target="_top">2566</a>:
<span class="emphasis"><em>Constructors for <code class="code">priority_queue</code> taking allocators <span class="emphasis"><em>Constructors for <code class="code">priority_queue</code> taking allocators
should call <code class="code">make_heap</code> should call <code class="code">make_heap</code>
</em></span> </em></span>
</span></dt><dd><p>Call <code class="code">make_heap</code>. </span></dt><dd><p>Call <code class="code">make_heap</code>.
</p></dd><dt><a id="manual.bugs.dr2566"></a><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2566" target="_top">2566</a>:
<span class="emphasis"><em>Requirements on the first template parameter of container adaptors
</em></span>
</span></dt><dd><p>Add static assertions to enforce the requirement.
</p></dd><dt><a id="manual.bugs.dr2583"></a><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2583" target="_top">2583</a>: </p></dd><dt><a id="manual.bugs.dr2583"></a><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2583" target="_top">2583</a>:
<span class="emphasis"><em>There is no way to supply an allocator for <code class="code">basic_string(str, pos)</code> <span class="emphasis"><em>There is no way to supply an allocator for <code class="code">basic_string(str, pos)</code>
</em></span> </em></span>
......
...@@ -129,7 +129,7 @@ ...@@ -129,7 +129,7 @@
<code class="literal">GLIBCXX_FORCE_NEW</code> to keep extraneous pool allocation <code class="literal">GLIBCXX_FORCE_NEW</code> to keep extraneous pool allocation
noise from cluttering debug information. noise from cluttering debug information.
For more details, see the For more details, see the
<a class="link" href="mt_allocator.html" title="Chapter 20. The mt_allocator">mt allocator</a> <a class="link" href="mt_allocator.html" title="Chapter 19. The mt_allocator">mt allocator</a>
documentation and look specifically for <code class="code">GLIBCXX_FORCE_NEW</code>. documentation and look specifically for <code class="code">GLIBCXX_FORCE_NEW</code>.
</p></div></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="debug.races"></a>Data Race Hunting</h3></div></div></div><p> </p></div></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="debug.races"></a>Data Race Hunting</h3></div></div></div><p>
All synchronization primitives used in the library internals need to be All synchronization primitives used in the library internals need to be
...@@ -233,9 +233,6 @@ ...@@ -233,9 +233,6 @@
has compile and run-time checks for many containers. has compile and run-time checks for many containers.
</p></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="debug.compile_time_checks"></a>Compile Time Checking</h3></div></div></div><p> The <a class="link" href="ext_compile_checks.html" title="Chapter 16. Compile Time Checks">Compile-Time </p></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="debug.compile_time_checks"></a>Compile Time Checking</h3></div></div></div><p> The <a class="link" href="ext_compile_checks.html" title="Chapter 16. Compile Time Checks">Compile-Time
Checks</a> extension has compile-time checks for many algorithms. Checks</a> extension has compile-time checks for many algorithms.
</p></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="debug.profile_mode"></a>Profile-based Performance Analysis</h3></div></div></div><p> The <a class="link" href="profile_mode.html" title="Chapter 19. Profile Mode">Profile-based
Performance Analysis</a> extension has performance checks for many
algorithms.
</p></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="using_exceptions.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="using.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="std_contents.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Exceptions </td><td width="20%" align="center"><a accesskey="h" href="../index.html">Home</a></td><td width="40%" align="right" valign="top"> Part II.  </p></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="using_exceptions.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="using.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="std_contents.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Exceptions </td><td width="20%" align="center"><a accesskey="h" href="../index.html">Home</a></td><td width="40%" align="right" valign="top"> Part II. 
Standard Contents Standard Contents
</td></tr></table></div></body></html> </td></tr></table></div></body></html>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Chapter 25. Algorithms</title><meta name="generator" content="DocBook XSL Stylesheets Vsnapshot" /><meta name="keywords" content="ISO C++, library" /><meta name="keywords" content="ISO C++, runtime, library" /><link rel="home" href="../index.html" title="The GNU C++ Library" /><link rel="up" href="extensions.html" title="Part III.  Extensions" /><link rel="prev" href="ext_utilities.html" title="Chapter 24. Utilities" /><link rel="next" href="ext_numerics.html" title="Chapter 26. Numerics" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 25. Algorithms</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ext_utilities.html">Prev</a> </td><th width="60%" align="center">Part III.  <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Chapter 24. Algorithms</title><meta name="generator" content="DocBook XSL Stylesheets Vsnapshot" /><meta name="keywords" content="ISO C++, library" /><meta name="keywords" content="ISO C++, runtime, library" /><link rel="home" href="../index.html" title="The GNU C++ Library" /><link rel="up" href="extensions.html" title="Part III.  Extensions" /><link rel="prev" href="ext_utilities.html" title="Chapter 23. Utilities" /><link rel="next" href="ext_numerics.html" title="Chapter 25. Numerics" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 24. Algorithms</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ext_utilities.html">Prev</a> </td><th width="60%" align="center">Part III. 
Extensions Extensions
</th><td width="20%" align="right"> <a accesskey="n" href="ext_numerics.html">Next</a></td></tr></table><hr /></div><div class="chapter"><div class="titlepage"><div><div><h2 class="title"><a id="manual.ext.algorithms"></a>Chapter 25. Algorithms</h2></div></div></div><p>25.1.6 (count, count_if) is extended with two more versions of count </th><td width="20%" align="right"> <a accesskey="n" href="ext_numerics.html">Next</a></td></tr></table><hr /></div><div class="chapter"><div class="titlepage"><div><div><h2 class="title"><a id="manual.ext.algorithms"></a>Chapter 24. Algorithms</h2></div></div></div><p>25.1.6 (count, count_if) is extended with two more versions of count
and count_if. The standard versions return their results. The and count_if. The standard versions return their results. The
additional signatures return void, but take a final parameter by additional signatures return void, but take a final parameter by
reference to which they assign their results, e.g., reference to which they assign their results, e.g.,
...@@ -19,4 +19,4 @@ ...@@ -19,4 +19,4 @@
</p><pre class="programlisting"> </p><pre class="programlisting">
lexicographical_compare_3way(_InputIter1 first1, _InputIter1 last1, lexicographical_compare_3way(_InputIter1 first1, _InputIter1 last1,
_InputIter2 first2, _InputIter2 last2)</pre><p>which does... what? _InputIter2 first2, _InputIter2 last2)</pre><p>which does... what?
</p></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="ext_utilities.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="extensions.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="ext_numerics.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Chapter 24. Utilities </td><td width="20%" align="center"><a accesskey="h" href="../index.html">Home</a></td><td width="40%" align="right" valign="top"> Chapter 26. Numerics</td></tr></table></div></body></html> </p></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="ext_utilities.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="extensions.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="ext_numerics.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Chapter 23. Utilities </td><td width="20%" align="center"><a accesskey="h" href="../index.html">Home</a></td><td width="40%" align="right" valign="top"> Chapter 25. Numerics</td></tr></table></div></body></html>
\ No newline at end of file \ No newline at end of file
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Chapter 30. Concurrency</title><meta name="generator" content="DocBook XSL Stylesheets Vsnapshot" /><meta name="keywords" content="ISO C++, library" /><meta name="keywords" content="ISO C++, library" /><meta name="keywords" content="ISO C++, runtime, library" /><link rel="home" href="../index.html" title="The GNU C++ Library" /><link rel="up" href="extensions.html" title="Part III.  Extensions" /><link rel="prev" href="ext_demangling.html" title="Chapter 29. Demangling" /><link rel="next" href="ext_concurrency_impl.html" title="Implementation" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 30. Concurrency</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ext_demangling.html">Prev</a> </td><th width="60%" align="center">Part III.  <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Chapter 29. Concurrency</title><meta name="generator" content="DocBook XSL Stylesheets Vsnapshot" /><meta name="keywords" content="ISO C++, library" /><meta name="keywords" content="ISO C++, library" /><meta name="keywords" content="ISO C++, runtime, library" /><link rel="home" href="../index.html" title="The GNU C++ Library" /><link rel="up" href="extensions.html" title="Part III.  Extensions" /><link rel="prev" href="ext_demangling.html" title="Chapter 28. Demangling" /><link rel="next" href="ext_concurrency_impl.html" title="Implementation" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 29. Concurrency</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ext_demangling.html">Prev</a> </td><th width="60%" align="center">Part III. 
Extensions Extensions
</th><td width="20%" align="right"> <a accesskey="n" href="ext_concurrency_impl.html">Next</a></td></tr></table><hr /></div><div class="chapter"><div class="titlepage"><div><div><h2 class="title"><a id="manual.ext.concurrency"></a>Chapter 30. Concurrency</h2></div></div></div><div class="toc"><p><strong>Table of Contents</strong></p><dl class="toc"><dt><span class="section"><a href="ext_concurrency.html#manual.ext.concurrency.design">Design</a></span></dt><dd><dl><dt><span class="section"><a href="ext_concurrency.html#manual.ext.concurrency.design.threads">Interface to Locks and Mutexes</a></span></dt><dt><span class="section"><a href="ext_concurrency.html#manual.ext.concurrency.design.atomics">Interface to Atomic Functions</a></span></dt></dl></dd><dt><span class="section"><a href="ext_concurrency_impl.html">Implementation</a></span></dt><dd><dl><dt><span class="section"><a href="ext_concurrency_impl.html#manual.ext.concurrency.impl.atomic_fallbacks">Using Built-in Atomic Functions</a></span></dt><dt><span class="section"><a href="ext_concurrency_impl.html#manual.ext.concurrency.impl.thread">Thread Abstraction</a></span></dt></dl></dd><dt><span class="section"><a href="ext_concurrency_use.html">Use</a></span></dt></dl></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="manual.ext.concurrency.design"></a>Design</h2></div></div></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="manual.ext.concurrency.design.threads"></a>Interface to Locks and Mutexes</h3></div></div></div><p>The file <code class="filename">&lt;ext/concurrence.h&gt;</code> </th><td width="20%" align="right"> <a accesskey="n" href="ext_concurrency_impl.html">Next</a></td></tr></table><hr /></div><div class="chapter"><div class="titlepage"><div><div><h2 class="title"><a id="manual.ext.concurrency"></a>Chapter 29. Concurrency</h2></div></div></div><div class="toc"><p><strong>Table of Contents</strong></p><dl class="toc"><dt><span class="section"><a href="ext_concurrency.html#manual.ext.concurrency.design">Design</a></span></dt><dd><dl><dt><span class="section"><a href="ext_concurrency.html#manual.ext.concurrency.design.threads">Interface to Locks and Mutexes</a></span></dt><dt><span class="section"><a href="ext_concurrency.html#manual.ext.concurrency.design.atomics">Interface to Atomic Functions</a></span></dt></dl></dd><dt><span class="section"><a href="ext_concurrency_impl.html">Implementation</a></span></dt><dd><dl><dt><span class="section"><a href="ext_concurrency_impl.html#manual.ext.concurrency.impl.atomic_fallbacks">Using Built-in Atomic Functions</a></span></dt><dt><span class="section"><a href="ext_concurrency_impl.html#manual.ext.concurrency.impl.thread">Thread Abstraction</a></span></dt></dl></dd><dt><span class="section"><a href="ext_concurrency_use.html">Use</a></span></dt></dl></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="manual.ext.concurrency.design"></a>Design</h2></div></div></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="manual.ext.concurrency.design.threads"></a>Interface to Locks and Mutexes</h3></div></div></div><p>The file <code class="filename">&lt;ext/concurrence.h&gt;</code>
contains all the higher-level contains all the higher-level
constructs for playing with threads. In contrast to the atomics layer, constructs for playing with threads. In contrast to the atomics layer,
the concurrence layer consists largely of types. All types are defined within <code class="code">namespace __gnu_cxx</code>. the concurrence layer consists largely of types. All types are defined within <code class="code">namespace __gnu_cxx</code>.
...@@ -90,4 +90,4 @@ _GLIBCXX_WRITE_MEM_BARRIER ...@@ -90,4 +90,4 @@ _GLIBCXX_WRITE_MEM_BARRIER
</p><p> </p><p>
Which expand to the appropriate write and read barrier required by the Which expand to the appropriate write and read barrier required by the
host hardware and operating system. host hardware and operating system.
</p></div></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="ext_demangling.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="extensions.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="ext_concurrency_impl.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Chapter 29. Demangling </td><td width="20%" align="center"><a accesskey="h" href="../index.html">Home</a></td><td width="40%" align="right" valign="top"> Implementation</td></tr></table></div></body></html> </p></div></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="ext_demangling.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="extensions.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="ext_concurrency_impl.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Chapter 28. Demangling </td><td width="20%" align="center"><a accesskey="h" href="../index.html">Home</a></td><td width="40%" align="right" valign="top"> Implementation</td></tr></table></div></body></html>
\ No newline at end of file \ No newline at end of file
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Implementation</title><meta name="generator" content="DocBook XSL Stylesheets Vsnapshot" /><meta name="keywords" content="ISO C++, library" /><meta name="keywords" content="ISO C++, library" /><meta name="keywords" content="ISO C++, runtime, library" /><link rel="home" href="../index.html" title="The GNU C++ Library" /><link rel="up" href="ext_concurrency.html" title="Chapter 30. Concurrency" /><link rel="prev" href="ext_concurrency.html" title="Chapter 30. Concurrency" /><link rel="next" href="ext_concurrency_use.html" title="Use" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Implementation</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ext_concurrency.html">Prev</a> </td><th width="60%" align="center">Chapter 30. Concurrency</th><td width="20%" align="right"> <a accesskey="n" href="ext_concurrency_use.html">Next</a></td></tr></table><hr /></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="manual.ext.concurrency.impl"></a>Implementation</h2></div></div></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="manual.ext.concurrency.impl.atomic_fallbacks"></a>Using Built-in Atomic Functions</h3></div></div></div><p>The functions for atomic operations described above are either <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Implementation</title><meta name="generator" content="DocBook XSL Stylesheets Vsnapshot" /><meta name="keywords" content="ISO C++, library" /><meta name="keywords" content="ISO C++, library" /><meta name="keywords" content="ISO C++, runtime, library" /><link rel="home" href="../index.html" title="The GNU C++ Library" /><link rel="up" href="ext_concurrency.html" title="Chapter 29. Concurrency" /><link rel="prev" href="ext_concurrency.html" title="Chapter 29. Concurrency" /><link rel="next" href="ext_concurrency_use.html" title="Use" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Implementation</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ext_concurrency.html">Prev</a> </td><th width="60%" align="center">Chapter 29. Concurrency</th><td width="20%" align="right"> <a accesskey="n" href="ext_concurrency_use.html">Next</a></td></tr></table><hr /></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="manual.ext.concurrency.impl"></a>Implementation</h2></div></div></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="manual.ext.concurrency.impl.atomic_fallbacks"></a>Using Built-in Atomic Functions</h3></div></div></div><p>The functions for atomic operations described above are either
implemented via compiler intrinsics (if the underlying host is implemented via compiler intrinsics (if the underlying host is
capable) or by library fallbacks.</p><p>Compiler intrinsics (builtins) are always preferred. However, as capable) or by library fallbacks.</p><p>Compiler intrinsics (builtins) are always preferred. However, as
the compiler builtins for atomics are not universally implemented, the compiler builtins for atomics are not universally implemented,
...@@ -49,4 +49,4 @@ use this layer. More detail as to the specific interface can be found in the sou ...@@ -49,4 +49,4 @@ use this layer. More detail as to the specific interface can be found in the sou
functions, and usage found in the usual &lt;pthread.h&gt; file, functions, and usage found in the usual &lt;pthread.h&gt; file,
including <code class="code">pthread_t</code>, <code class="code">pthread_once_t</code>, <code class="code">pthread_create</code>, including <code class="code">pthread_t</code>, <code class="code">pthread_once_t</code>, <code class="code">pthread_create</code>,
etc. etc.
</p></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="ext_concurrency.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="ext_concurrency.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="ext_concurrency_use.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Chapter 30. Concurrency </td><td width="20%" align="center"><a accesskey="h" href="../index.html">Home</a></td><td width="40%" align="right" valign="top"> Use</td></tr></table></div></body></html> </p></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="ext_concurrency.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="ext_concurrency.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="ext_concurrency_use.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Chapter 29. Concurrency </td><td width="20%" align="center"><a accesskey="h" href="../index.html">Home</a></td><td width="40%" align="right" valign="top"> Use</td></tr></table></div></body></html>
\ No newline at end of file \ No newline at end of file
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Use</title><meta name="generator" content="DocBook XSL Stylesheets Vsnapshot" /><meta name="keywords" content="ISO C++, library" /><meta name="keywords" content="ISO C++, library" /><meta name="keywords" content="ISO C++, runtime, library" /><link rel="home" href="../index.html" title="The GNU C++ Library" /><link rel="up" href="ext_concurrency.html" title="Chapter 30. Concurrency" /><link rel="prev" href="ext_concurrency_impl.html" title="Implementation" /><link rel="next" href="appendix.html" title="Part IV.  Appendices" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Use</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ext_concurrency_impl.html">Prev</a> </td><th width="60%" align="center">Chapter 30. Concurrency</th><td width="20%" align="right"> <a accesskey="n" href="appendix.html">Next</a></td></tr></table><hr /></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="manual.ext.concurrency.use"></a>Use</h2></div></div></div><p>Typical usage of the last two constructs is demonstrated as follows: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Use</title><meta name="generator" content="DocBook XSL Stylesheets Vsnapshot" /><meta name="keywords" content="ISO C++, library" /><meta name="keywords" content="ISO C++, library" /><meta name="keywords" content="ISO C++, runtime, library" /><link rel="home" href="../index.html" title="The GNU C++ Library" /><link rel="up" href="ext_concurrency.html" title="Chapter 29. Concurrency" /><link rel="prev" href="ext_concurrency_impl.html" title="Implementation" /><link rel="next" href="appendix.html" title="Part IV.  Appendices" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Use</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ext_concurrency_impl.html">Prev</a> </td><th width="60%" align="center">Chapter 29. Concurrency</th><td width="20%" align="right"> <a accesskey="n" href="appendix.html">Next</a></td></tr></table><hr /></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="manual.ext.concurrency.use"></a>Use</h2></div></div></div><p>Typical usage of the last two constructs is demonstrated as follows:
</p><pre class="programlisting"> </p><pre class="programlisting">
#include &lt;ext/concurrence.h&gt; #include &lt;ext/concurrence.h&gt;
......
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Chapter 23. HP/SGI Extensions</title><meta name="generator" content="DocBook XSL Stylesheets Vsnapshot" /><meta name="keywords" content="ISO C++, library" /><meta name="keywords" content="ISO C++, runtime, library" /><link rel="home" href="../index.html" title="The GNU C++ Library" /><link rel="up" href="extensions.html" title="Part III.  Extensions" /><link rel="prev" href="policy_data_structures_ack.html" title="Acknowledgments" /><link rel="next" href="ext_sgi.html" title="Deprecated" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 23. HP/SGI Extensions</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="policy_data_structures_ack.html">Prev</a> </td><th width="60%" align="center">Part III.  <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Chapter 22. HP/SGI Extensions</title><meta name="generator" content="DocBook XSL Stylesheets Vsnapshot" /><meta name="keywords" content="ISO C++, library" /><meta name="keywords" content="ISO C++, runtime, library" /><link rel="home" href="../index.html" title="The GNU C++ Library" /><link rel="up" href="extensions.html" title="Part III.  Extensions" /><link rel="prev" href="policy_data_structures_ack.html" title="Acknowledgments" /><link rel="next" href="ext_sgi.html" title="Deprecated" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 22. HP/SGI Extensions</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="policy_data_structures_ack.html">Prev</a> </td><th width="60%" align="center">Part III. 
Extensions Extensions
</th><td width="20%" align="right"> <a accesskey="n" href="ext_sgi.html">Next</a></td></tr></table><hr /></div><div class="chapter"><div class="titlepage"><div><div><h2 class="title"><a id="manual.ext.containers"></a>Chapter 23. HP/SGI Extensions</h2></div></div></div><div class="toc"><p><strong>Table of Contents</strong></p><dl class="toc"><dt><span class="section"><a href="ext_containers.html#manual.ext.containers.sgi">Backwards Compatibility</a></span></dt><dt><span class="section"><a href="ext_sgi.html">Deprecated</a></span></dt></dl></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="manual.ext.containers.sgi"></a>Backwards Compatibility</h2></div></div></div><p>A few extensions and nods to backwards-compatibility have </th><td width="20%" align="right"> <a accesskey="n" href="ext_sgi.html">Next</a></td></tr></table><hr /></div><div class="chapter"><div class="titlepage"><div><div><h2 class="title"><a id="manual.ext.containers"></a>Chapter 22. HP/SGI Extensions</h2></div></div></div><div class="toc"><p><strong>Table of Contents</strong></p><dl class="toc"><dt><span class="section"><a href="ext_containers.html#manual.ext.containers.sgi">Backwards Compatibility</a></span></dt><dt><span class="section"><a href="ext_sgi.html">Deprecated</a></span></dt></dl></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="manual.ext.containers.sgi"></a>Backwards Compatibility</h2></div></div></div><p>A few extensions and nods to backwards-compatibility have
been made with containers. Those dealing with older SGI-style been made with containers. Those dealing with older SGI-style
allocators are dealt with elsewhere. The remaining ones all deal allocators are dealt with elsewhere. The remaining ones all deal
with bits: with bits:
......
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Chapter 29. Demangling</title><meta name="generator" content="DocBook XSL Stylesheets Vsnapshot" /><meta name="keywords" content="ISO C++, library" /><meta name="keywords" content="ISO C++, runtime, library" /><link rel="home" href="../index.html" title="The GNU C++ Library" /><link rel="up" href="extensions.html" title="Part III.  Extensions" /><link rel="prev" href="ext_io.html" title="Chapter 28. Input and Output" /><link rel="next" href="ext_concurrency.html" title="Chapter 30. Concurrency" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 29. Demangling</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ext_io.html">Prev</a> </td><th width="60%" align="center">Part III.  <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Chapter 28. Demangling</title><meta name="generator" content="DocBook XSL Stylesheets Vsnapshot" /><meta name="keywords" content="ISO C++, library" /><meta name="keywords" content="ISO C++, runtime, library" /><link rel="home" href="../index.html" title="The GNU C++ Library" /><link rel="up" href="extensions.html" title="Part III.  Extensions" /><link rel="prev" href="ext_io.html" title="Chapter 27. Input and Output" /><link rel="next" href="ext_concurrency.html" title="Chapter 29. Concurrency" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 28. Demangling</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ext_io.html">Prev</a> </td><th width="60%" align="center">Part III. 
Extensions Extensions
</th><td width="20%" align="right"> <a accesskey="n" href="ext_concurrency.html">Next</a></td></tr></table><hr /></div><div class="chapter"><div class="titlepage"><div><div><h2 class="title"><a id="manual.ext.demangle"></a>Chapter 29. Demangling</h2></div></div></div><p> </th><td width="20%" align="right"> <a accesskey="n" href="ext_concurrency.html">Next</a></td></tr></table><hr /></div><div class="chapter"><div class="titlepage"><div><div><h2 class="title"><a id="manual.ext.demangle"></a>Chapter 28. Demangling</h2></div></div></div><p>
Transforming C++ ABI identifiers (like RTTI symbols) into the Transforming C++ ABI identifiers (like RTTI symbols) into the
original C++ source identifiers is called original C++ source identifiers is called
<span class="quote"><span class="quote">demangling.</span></span> <span class="quote"><span class="quote">demangling.</span></span>
...@@ -70,4 +70,4 @@ int main() ...@@ -70,4 +70,4 @@ int main()
be writing C++ in order to demangle C++. (That also means we have to be writing C++ in order to demangle C++. (That also means we have to
use crummy memory management facilities, so don't forget to free() use crummy memory management facilities, so don't forget to free()
the returned char array.) the returned char array.)
</p></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="ext_io.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="extensions.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="ext_concurrency.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Chapter 28. Input and Output </td><td width="20%" align="center"><a accesskey="h" href="../index.html">Home</a></td><td width="40%" align="right" valign="top"> Chapter 30. Concurrency</td></tr></table></div></body></html> </p></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="ext_io.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="extensions.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="ext_concurrency.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Chapter 27. Input and Output </td><td width="20%" align="center"><a accesskey="h" href="../index.html">Home</a></td><td width="40%" align="right" valign="top"> Chapter 29. Concurrency</td></tr></table></div></body></html>
\ No newline at end of file \ No newline at end of file
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Chapter 28. Input and Output</title><meta name="generator" content="DocBook XSL Stylesheets Vsnapshot" /><meta name="keywords" content="ISO C++, library" /><meta name="keywords" content="ISO C++, runtime, library" /><link rel="home" href="../index.html" title="The GNU C++ Library" /><link rel="up" href="extensions.html" title="Part III.  Extensions" /><link rel="prev" href="ext_iterators.html" title="Chapter 27. Iterators" /><link rel="next" href="ext_demangling.html" title="Chapter 29. Demangling" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 28. Input and Output</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ext_iterators.html">Prev</a> </td><th width="60%" align="center">Part III.  <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Chapter 27. Input and Output</title><meta name="generator" content="DocBook XSL Stylesheets Vsnapshot" /><meta name="keywords" content="ISO C++, library" /><meta name="keywords" content="ISO C++, runtime, library" /><link rel="home" href="../index.html" title="The GNU C++ Library" /><link rel="up" href="extensions.html" title="Part III.  Extensions" /><link rel="prev" href="ext_iterators.html" title="Chapter 26. Iterators" /><link rel="next" href="ext_demangling.html" title="Chapter 28. Demangling" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 27. Input and Output</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ext_iterators.html">Prev</a> </td><th width="60%" align="center">Part III. 
Extensions Extensions
</th><td width="20%" align="right"> <a accesskey="n" href="ext_demangling.html">Next</a></td></tr></table><hr /></div><div class="chapter"><div class="titlepage"><div><div><h2 class="title"><a id="manual.ext.io"></a>Chapter 28. Input and Output</h2></div></div></div><div class="toc"><p><strong>Table of Contents</strong></p><dl class="toc"><dt><span class="section"><a href="ext_io.html#manual.ext.io.filebuf_derived">Derived filebufs</a></span></dt></dl></div><p> </th><td width="20%" align="right"> <a accesskey="n" href="ext_demangling.html">Next</a></td></tr></table><hr /></div><div class="chapter"><div class="titlepage"><div><div><h2 class="title"><a id="manual.ext.io"></a>Chapter 27. Input and Output</h2></div></div></div><div class="toc"><p><strong>Table of Contents</strong></p><dl class="toc"><dt><span class="section"><a href="ext_io.html#manual.ext.io.filebuf_derived">Derived filebufs</a></span></dt></dl></div><p>
Extensions allowing <code class="code">filebuf</code>s to be constructed from Extensions allowing <code class="code">filebuf</code>s to be constructed from
"C" types like FILE*s and file descriptors. "C" types like FILE*s and file descriptors.
</p><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="manual.ext.io.filebuf_derived"></a>Derived filebufs</h2></div></div></div><p>The v2 library included non-standard extensions to construct </p><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="manual.ext.io.filebuf_derived"></a>Derived filebufs</h2></div></div></div><p>The v2 library included non-standard extensions to construct
...@@ -43,4 +43,4 @@ ...@@ -43,4 +43,4 @@
<code class="classname">__gnu_cxx::stdio_filebuf</code>. <code class="classname">__gnu_cxx::stdio_filebuf</code>.
This class can be constructed from a C <code class="code">FILE*</code> or a file This class can be constructed from a C <code class="code">FILE*</code> or a file
descriptor, and provides the <code class="code">fd()</code> function. descriptor, and provides the <code class="code">fd()</code> function.
</p></li></ul></div></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="ext_iterators.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="extensions.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="ext_demangling.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Chapter 27. Iterators </td><td width="20%" align="center"><a accesskey="h" href="../index.html">Home</a></td><td width="40%" align="right" valign="top"> Chapter 29. Demangling</td></tr></table></div></body></html> </p></li></ul></div></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="ext_iterators.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="extensions.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="ext_demangling.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Chapter 26. Iterators </td><td width="20%" align="center"><a accesskey="h" href="../index.html">Home</a></td><td width="40%" align="right" valign="top"> Chapter 28. Demangling</td></tr></table></div></body></html>
\ No newline at end of file \ No newline at end of file
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Chapter 27. Iterators</title><meta name="generator" content="DocBook XSL Stylesheets Vsnapshot" /><meta name="keywords" content="ISO C++, library" /><meta name="keywords" content="ISO C++, runtime, library" /><link rel="home" href="../index.html" title="The GNU C++ Library" /><link rel="up" href="extensions.html" title="Part III.  Extensions" /><link rel="prev" href="ext_numerics.html" title="Chapter 26. Numerics" /><link rel="next" href="ext_io.html" title="Chapter 28. Input and Output" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 27. Iterators</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ext_numerics.html">Prev</a> </td><th width="60%" align="center">Part III.  <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Chapter 26. Iterators</title><meta name="generator" content="DocBook XSL Stylesheets Vsnapshot" /><meta name="keywords" content="ISO C++, library" /><meta name="keywords" content="ISO C++, runtime, library" /><link rel="home" href="../index.html" title="The GNU C++ Library" /><link rel="up" href="extensions.html" title="Part III.  Extensions" /><link rel="prev" href="ext_numerics.html" title="Chapter 25. Numerics" /><link rel="next" href="ext_io.html" title="Chapter 27. Input and Output" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 26. Iterators</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ext_numerics.html">Prev</a> </td><th width="60%" align="center">Part III. 
Extensions Extensions
</th><td width="20%" align="right"> <a accesskey="n" href="ext_io.html">Next</a></td></tr></table><hr /></div><div class="chapter"><div class="titlepage"><div><div><h2 class="title"><a id="manual.ext.iterators"></a>Chapter 27. Iterators</h2></div></div></div><p>24.3.2 describes <code class="code">struct iterator</code>, which didn't exist in the </th><td width="20%" align="right"> <a accesskey="n" href="ext_io.html">Next</a></td></tr></table><hr /></div><div class="chapter"><div class="titlepage"><div><div><h2 class="title"><a id="manual.ext.iterators"></a>Chapter 26. Iterators</h2></div></div></div><p>24.3.2 describes <code class="code">struct iterator</code>, which didn't exist in the
original HP STL implementation (the language wasn't rich enough at the original HP STL implementation (the language wasn't rich enough at the
time). For backwards compatibility, base classes are provided which time). For backwards compatibility, base classes are provided which
declare the same nested typedefs: declare the same nested typedefs:
...@@ -10,4 +10,4 @@ ...@@ -10,4 +10,4 @@
two iterators and returns a result. It is extended by another signature two iterators and returns a result. It is extended by another signature
which takes two iterators and a reference to a result. The result is which takes two iterators and a reference to a result. The result is
modified, and the function returns nothing. modified, and the function returns nothing.
</p></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="ext_numerics.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="extensions.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="ext_io.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Chapter 26. Numerics </td><td width="20%" align="center"><a accesskey="h" href="../index.html">Home</a></td><td width="40%" align="right" valign="top"> Chapter 28. Input and Output</td></tr></table></div></body></html> </p></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="ext_numerics.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="extensions.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="ext_io.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Chapter 25. Numerics </td><td width="20%" align="center"><a accesskey="h" href="../index.html">Home</a></td><td width="40%" align="right" valign="top"> Chapter 27. Input and Output</td></tr></table></div></body></html>
\ No newline at end of file \ No newline at end of file
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Chapter 26. Numerics</title><meta name="generator" content="DocBook XSL Stylesheets Vsnapshot" /><meta name="keywords" content="ISO C++, library" /><meta name="keywords" content="ISO C++, runtime, library" /><link rel="home" href="../index.html" title="The GNU C++ Library" /><link rel="up" href="extensions.html" title="Part III.  Extensions" /><link rel="prev" href="ext_algorithms.html" title="Chapter 25. Algorithms" /><link rel="next" href="ext_iterators.html" title="Chapter 27. Iterators" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 26. Numerics</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ext_algorithms.html">Prev</a> </td><th width="60%" align="center">Part III.  <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Chapter 25. Numerics</title><meta name="generator" content="DocBook XSL Stylesheets Vsnapshot" /><meta name="keywords" content="ISO C++, library" /><meta name="keywords" content="ISO C++, runtime, library" /><link rel="home" href="../index.html" title="The GNU C++ Library" /><link rel="up" href="extensions.html" title="Part III.  Extensions" /><link rel="prev" href="ext_algorithms.html" title="Chapter 24. Algorithms" /><link rel="next" href="ext_iterators.html" title="Chapter 26. Iterators" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 25. Numerics</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ext_algorithms.html">Prev</a> </td><th width="60%" align="center">Part III. 
Extensions Extensions
</th><td width="20%" align="right"> <a accesskey="n" href="ext_iterators.html">Next</a></td></tr></table><hr /></div><div class="chapter"><div class="titlepage"><div><div><h2 class="title"><a id="manual.ext.numerics"></a>Chapter 26. Numerics</h2></div></div></div><p>26.4, the generalized numeric operations such as <code class="code">accumulate</code>, </th><td width="20%" align="right"> <a accesskey="n" href="ext_iterators.html">Next</a></td></tr></table><hr /></div><div class="chapter"><div class="titlepage"><div><div><h2 class="title"><a id="manual.ext.numerics"></a>Chapter 25. Numerics</h2></div></div></div><p>26.4, the generalized numeric operations such as <code class="code">accumulate</code>,
are extended with the following functions: are extended with the following functions:
</p><pre class="programlisting"> </p><pre class="programlisting">
power (x, n); power (x, n);
...@@ -20,4 +20,4 @@ ...@@ -20,4 +20,4 @@
<code class="code">value + 1</code> to<code class="code"> *(first + 1)</code> and so on." <code class="code">value + 1</code> to<code class="code"> *(first + 1)</code> and so on."
</p><pre class="programlisting"> </p><pre class="programlisting">
void iota(_ForwardIter first, _ForwardIter last, _Tp value);</pre><p>The <code class="code">iota</code> function is included in the ISO C++ 2011 standard. void iota(_ForwardIter first, _ForwardIter last, _Tp value);</pre><p>The <code class="code">iota</code> function is included in the ISO C++ 2011 standard.
</p></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="ext_algorithms.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="extensions.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="ext_iterators.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Chapter 25. Algorithms </td><td width="20%" align="center"><a accesskey="h" href="../index.html">Home</a></td><td width="40%" align="right" valign="top"> Chapter 27. Iterators</td></tr></table></div></body></html> </p></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="ext_algorithms.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="extensions.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="ext_iterators.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Chapter 24. Algorithms </td><td width="20%" align="center"><a accesskey="h" href="../index.html">Home</a></td><td width="40%" align="right" valign="top"> Chapter 26. Iterators</td></tr></table></div></body></html>
\ No newline at end of file \ No newline at end of file
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Deprecated</title><meta name="generator" content="DocBook XSL Stylesheets Vsnapshot" /><meta name="keywords" content="ISO C++, library" /><meta name="keywords" content="ISO C++, runtime, library" /><link rel="home" href="../index.html" title="The GNU C++ Library" /><link rel="up" href="ext_containers.html" title="Chapter 23. HP/SGI Extensions" /><link rel="prev" href="ext_containers.html" title="Chapter 23. HP/SGI Extensions" /><link rel="next" href="ext_utilities.html" title="Chapter 24. Utilities" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Deprecated</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ext_containers.html">Prev</a> </td><th width="60%" align="center">Chapter 23. HP/SGI Extensions</th><td width="20%" align="right"> <a accesskey="n" href="ext_utilities.html">Next</a></td></tr></table><hr /></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="manual.ext.containers.deprecated_sgi"></a>Deprecated</h2></div></div></div><p> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Deprecated</title><meta name="generator" content="DocBook XSL Stylesheets Vsnapshot" /><meta name="keywords" content="ISO C++, library" /><meta name="keywords" content="ISO C++, runtime, library" /><link rel="home" href="../index.html" title="The GNU C++ Library" /><link rel="up" href="ext_containers.html" title="Chapter 22. HP/SGI Extensions" /><link rel="prev" href="ext_containers.html" title="Chapter 22. HP/SGI Extensions" /><link rel="next" href="ext_utilities.html" title="Chapter 23. Utilities" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Deprecated</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ext_containers.html">Prev</a> </td><th width="60%" align="center">Chapter 22. HP/SGI Extensions</th><td width="20%" align="right"> <a accesskey="n" href="ext_utilities.html">Next</a></td></tr></table><hr /></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="manual.ext.containers.deprecated_sgi"></a>Deprecated</h2></div></div></div><p>
The SGI hashing classes <code class="classname">hash_set</code> and The SGI hashing classes <code class="classname">hash_set</code> and
<code class="classname">hash_set</code> have been deprecated by the <code class="classname">hash_set</code> have been deprecated by the
unordered_set, unordered_multiset, unordered_map, unordered_set, unordered_multiset, unordered_map,
...@@ -55,4 +55,4 @@ ...@@ -55,4 +55,4 @@
associative containers defined in the ISO C++ 2011 standard in the associative containers defined in the ISO C++ 2011 standard in the
headers <code class="filename">&lt;unordered_map&gt;</code> headers <code class="filename">&lt;unordered_map&gt;</code>
and <code class="filename">&lt;unordered_set&gt;</code>. and <code class="filename">&lt;unordered_set&gt;</code>.
</p></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="ext_containers.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="ext_containers.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="ext_utilities.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Chapter 23. HP/SGI Extensions </td><td width="20%" align="center"><a accesskey="h" href="../index.html">Home</a></td><td width="40%" align="right" valign="top"> Chapter 24. Utilities</td></tr></table></div></body></html> </p></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="ext_containers.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="ext_containers.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="ext_utilities.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Chapter 22. HP/SGI Extensions </td><td width="20%" align="center"><a accesskey="h" href="../index.html">Home</a></td><td width="40%" align="right" valign="top"> Chapter 23. Utilities</td></tr></table></div></body></html>
\ No newline at end of file \ No newline at end of file
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Chapter 24. Utilities</title><meta name="generator" content="DocBook XSL Stylesheets Vsnapshot" /><meta name="keywords" content="ISO C++, library" /><meta name="keywords" content="ISO C++, runtime, library" /><link rel="home" href="../index.html" title="The GNU C++ Library" /><link rel="up" href="extensions.html" title="Part III.  Extensions" /><link rel="prev" href="ext_sgi.html" title="Deprecated" /><link rel="next" href="ext_algorithms.html" title="Chapter 25. Algorithms" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 24. Utilities</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ext_sgi.html">Prev</a> </td><th width="60%" align="center">Part III.  <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Chapter 23. Utilities</title><meta name="generator" content="DocBook XSL Stylesheets Vsnapshot" /><meta name="keywords" content="ISO C++, library" /><meta name="keywords" content="ISO C++, runtime, library" /><link rel="home" href="../index.html" title="The GNU C++ Library" /><link rel="up" href="extensions.html" title="Part III.  Extensions" /><link rel="prev" href="ext_sgi.html" title="Deprecated" /><link rel="next" href="ext_algorithms.html" title="Chapter 24. Algorithms" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 23. Utilities</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ext_sgi.html">Prev</a> </td><th width="60%" align="center">Part III. 
Extensions Extensions
</th><td width="20%" align="right"> <a accesskey="n" href="ext_algorithms.html">Next</a></td></tr></table><hr /></div><div class="chapter"><div class="titlepage"><div><div><h2 class="title"><a id="manual.ext.util"></a>Chapter 24. Utilities</h2></div></div></div><p> </th><td width="20%" align="right"> <a accesskey="n" href="ext_algorithms.html">Next</a></td></tr></table><hr /></div><div class="chapter"><div class="titlepage"><div><div><h2 class="title"><a id="manual.ext.util"></a>Chapter 23. Utilities</h2></div></div></div><p>
The <code class="filename">&lt;functional&gt;</code> header The <code class="filename">&lt;functional&gt;</code> header
contains many additional functors contains many additional functors
and helper functions, extending section 20.3. They are and helper functions, extending section 20.3. They are
...@@ -38,4 +38,4 @@ get_temporary_buffer(5, (int*)0); ...@@ -38,4 +38,4 @@ get_temporary_buffer(5, (int*)0);
</p><p> </p><p>
The specialized algorithms of section 20.4.4 are extended with The specialized algorithms of section 20.4.4 are extended with
<code class="code">uninitialized_copy_n</code>. <code class="code">uninitialized_copy_n</code>.
</p></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="ext_sgi.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="extensions.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="ext_algorithms.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Deprecated </td><td width="20%" align="center"><a accesskey="h" href="../index.html">Home</a></td><td width="40%" align="right" valign="top"> Chapter 25. Algorithms</td></tr></table></div></body></html> </p></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="ext_sgi.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="extensions.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="ext_algorithms.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Deprecated </td><td width="20%" align="center"><a accesskey="h" href="../index.html">Home</a></td><td width="40%" align="right" valign="top"> Chapter 24. Algorithms</td></tr></table></div></body></html>
\ No newline at end of file \ No newline at end of file
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
Input and Output Input and Output
</th><td width="20%" align="right"> <a accesskey="n" href="atomics.html">Next</a></td></tr></table><hr /></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="std.io.c"></a>Interacting with C</h2></div></div></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="std.io.c.FILE"></a>Using FILE* and file descriptors</h3></div></div></div><p> </th><td width="20%" align="right"> <a accesskey="n" href="atomics.html">Next</a></td></tr></table><hr /></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="std.io.c"></a>Interacting with C</h2></div></div></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="std.io.c.FILE"></a>Using FILE* and file descriptors</h3></div></div></div><p>
See the <a class="link" href="ext_io.html" title="Chapter 28. Input and Output">extensions</a> for using See the <a class="link" href="ext_io.html" title="Chapter 27. Input and Output">extensions</a> for using
<span class="type">FILE</span> and <span class="type">file descriptors</span> with <span class="type">FILE</span> and <span class="type">file descriptors</span> with
<code class="classname">ofstream</code> and <code class="classname">ofstream</code> and
<code class="classname">ifstream</code>. <code class="classname">ifstream</code>.
......
...@@ -222,19 +222,6 @@ ...@@ -222,19 +222,6 @@
<code class="function">new</code>/<code class="function">delete</code> this is <code class="function">new</code>/<code class="function">delete</code> this is
taken care of elsewhere). taken care of elsewhere).
</p></li><li class="listitem"><p> </p></li><li class="listitem"><p>
<code class="classname">array_allocator</code>
</p><p>
Allows allocations of known and fixed sizes using existing
global or external storage allocated via construction of
<code class="classname">std::tr1::array</code> objects. By using this
allocator, fixed size containers (including
<code class="classname">std::string</code>) can be used without
instances calling <code class="function">::operator new</code> and
<code class="function">::operator delete</code>. This capability
allows the use of STL abstractions without runtime
complications or overhead, even in situations such as program
startup. For usage examples, please consult the testsuite.
</p></li><li class="listitem"><p>
<code class="classname">debug_allocator</code> <code class="classname">debug_allocator</code>
</p><p> </p><p>
A wrapper around an arbitrary allocator A. It passes on A wrapper around an arbitrary allocator A. It passes on
...@@ -300,14 +287,14 @@ ...@@ -300,14 +287,14 @@
</p><p> </p><p>
A high-performance fixed-size allocator with A high-performance fixed-size allocator with
exponentially-increasing allocations. It has its own exponentially-increasing allocations. It has its own
<a class="link" href="mt_allocator.html" title="Chapter 20. The mt_allocator">chapter</a> <a class="link" href="mt_allocator.html" title="Chapter 19. The mt_allocator">chapter</a>
in the documentation. in the documentation.
</p></li><li class="listitem"><p> </p></li><li class="listitem"><p>
<code class="classname">bitmap_allocator</code> <code class="classname">bitmap_allocator</code>
</p><p> </p><p>
A high-performance allocator that uses a bit-map to keep track A high-performance allocator that uses a bit-map to keep track
of the used and unused memory locations. It has its own of the used and unused memory locations. It has its own
<a class="link" href="bitmap_allocator.html" title="Chapter 21. The bitmap_allocator">chapter</a> <a class="link" href="bitmap_allocator.html" title="Chapter 20. The bitmap_allocator">chapter</a>
in the documentation. in the documentation.
</p></li></ol></div></div><div class="bibliography"><div class="titlepage"><div><div><h4 class="title"><a id="allocator.biblio"></a>Bibliography</h4></div></div></div><div class="biblioentry"><a id="id-1.3.4.4.4.3.9.2"></a><p><span class="citetitle"><em class="citetitle"> </p></li></ol></div></div><div class="bibliography"><div class="titlepage"><div><div><h4 class="title"><a id="allocator.biblio"></a>Bibliography</h4></div></div></div><div class="biblioentry"><a id="id-1.3.4.4.4.3.9.2"></a><p><span class="citetitle"><em class="citetitle">
ISO/IEC 14882:1998 Programming languages - C++ ISO/IEC 14882:1998 Programming languages - C++
......
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Chapter 20. The mt_allocator</title><meta name="generator" content="DocBook XSL Stylesheets Vsnapshot" /><meta name="keywords" content="ISO C++, allocator" /><meta name="keywords" content="ISO C++, library" /><meta name="keywords" content="ISO C++, runtime, library" /><link rel="home" href="../index.html" title="The GNU C++ Library" /><link rel="up" href="extensions.html" title="Part III.  Extensions" /><link rel="prev" href="profile_mode_diagnostics.html" title="Diagnostics" /><link rel="next" href="mt_allocator_design.html" title="Design Issues" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 20. The mt_allocator</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="profile_mode_diagnostics.html">Prev</a> </td><th width="60%" align="center">Part III.  <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Chapter 19. The mt_allocator</title><meta name="generator" content="DocBook XSL Stylesheets Vsnapshot" /><meta name="keywords" content="ISO C++, allocator" /><meta name="keywords" content="ISO C++, library" /><meta name="keywords" content="ISO C++, runtime, library" /><link rel="home" href="../index.html" title="The GNU C++ Library" /><link rel="up" href="extensions.html" title="Part III.  Extensions" /><link rel="prev" href="parallel_mode_test.html" title="Testing" /><link rel="next" href="mt_allocator_design.html" title="Design Issues" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 19. The mt_allocator</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="parallel_mode_test.html">Prev</a> </td><th width="60%" align="center">Part III. 
Extensions Extensions
</th><td width="20%" align="right"> <a accesskey="n" href="mt_allocator_design.html">Next</a></td></tr></table><hr /></div><div class="chapter"><div class="titlepage"><div><div><h2 class="title"><a id="manual.ext.allocator.mt"></a>Chapter 20. The mt_allocator</h2></div></div></div><div class="toc"><p><strong>Table of Contents</strong></p><dl class="toc"><dt><span class="section"><a href="mt_allocator.html#allocator.mt.intro">Intro</a></span></dt><dt><span class="section"><a href="mt_allocator_design.html">Design Issues</a></span></dt><dd><dl><dt><span class="section"><a href="mt_allocator_design.html#allocator.mt.overview">Overview</a></span></dt></dl></dd><dt><span class="section"><a href="mt_allocator_impl.html">Implementation</a></span></dt><dd><dl><dt><span class="section"><a href="mt_allocator_impl.html#allocator.mt.tune">Tunable Parameters</a></span></dt><dt><span class="section"><a href="mt_allocator_impl.html#allocator.mt.init">Initialization</a></span></dt><dt><span class="section"><a href="mt_allocator_impl.html#allocator.mt.deallocation">Deallocation Notes</a></span></dt></dl></dd><dt><span class="section"><a href="mt_allocator_ex_single.html">Single Thread Example</a></span></dt><dt><span class="section"><a href="mt_allocator_ex_multi.html">Multiple Thread Example</a></span></dt></dl></div><p> </th><td width="20%" align="right"> <a accesskey="n" href="mt_allocator_design.html">Next</a></td></tr></table><hr /></div><div class="chapter"><div class="titlepage"><div><div><h2 class="title"><a id="manual.ext.allocator.mt"></a>Chapter 19. The mt_allocator</h2></div></div></div><div class="toc"><p><strong>Table of Contents</strong></p><dl class="toc"><dt><span class="section"><a href="mt_allocator.html#allocator.mt.intro">Intro</a></span></dt><dt><span class="section"><a href="mt_allocator_design.html">Design Issues</a></span></dt><dd><dl><dt><span class="section"><a href="mt_allocator_design.html#allocator.mt.overview">Overview</a></span></dt></dl></dd><dt><span class="section"><a href="mt_allocator_impl.html">Implementation</a></span></dt><dd><dl><dt><span class="section"><a href="mt_allocator_impl.html#allocator.mt.tune">Tunable Parameters</a></span></dt><dt><span class="section"><a href="mt_allocator_impl.html#allocator.mt.init">Initialization</a></span></dt><dt><span class="section"><a href="mt_allocator_impl.html#allocator.mt.deallocation">Deallocation Notes</a></span></dt></dl></dd><dt><span class="section"><a href="mt_allocator_ex_single.html">Single Thread Example</a></span></dt><dt><span class="section"><a href="mt_allocator_ex_multi.html">Multiple Thread Example</a></span></dt></dl></div><p>
</p><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="allocator.mt.intro"></a>Intro</h2></div></div></div><p> </p><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="allocator.mt.intro"></a>Intro</h2></div></div></div><p>
The mt allocator [hereinafter referred to simply as "the allocator"] The mt allocator [hereinafter referred to simply as "the allocator"]
is a fixed size (power of two) allocator that was initially is a fixed size (power of two) allocator that was initially
...@@ -19,4 +19,4 @@ ...@@ -19,4 +19,4 @@
</p><p> </p><p>
The aim of this document is to describe - from an application point of The aim of this document is to describe - from an application point of
view - the "inner workings" of the allocator. view - the "inner workings" of the allocator.
</p></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="profile_mode_diagnostics.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="extensions.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="mt_allocator_design.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Diagnostics </td><td width="20%" align="center"><a accesskey="h" href="../index.html">Home</a></td><td width="40%" align="right" valign="top"> Design Issues</td></tr></table></div></body></html> </p></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="parallel_mode_test.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="extensions.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="mt_allocator_design.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Testing </td><td width="20%" align="center"><a accesskey="h" href="../index.html">Home</a></td><td width="40%" align="right" valign="top"> Design Issues</td></tr></table></div></body></html>
\ No newline at end of file \ No newline at end of file
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Design Issues</title><meta name="generator" content="DocBook XSL Stylesheets Vsnapshot" /><meta name="keywords" content="ISO C++, allocator" /><meta name="keywords" content="ISO C++, library" /><meta name="keywords" content="ISO C++, runtime, library" /><link rel="home" href="../index.html" title="The GNU C++ Library" /><link rel="up" href="mt_allocator.html" title="Chapter 20. The mt_allocator" /><link rel="prev" href="mt_allocator.html" title="Chapter 20. The mt_allocator" /><link rel="next" href="mt_allocator_impl.html" title="Implementation" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Design Issues</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="mt_allocator.html">Prev</a> </td><th width="60%" align="center">Chapter 20. The mt_allocator</th><td width="20%" align="right"> <a accesskey="n" href="mt_allocator_impl.html">Next</a></td></tr></table><hr /></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="allocator.mt.design_issues"></a>Design Issues</h2></div></div></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="allocator.mt.overview"></a>Overview</h3></div></div></div><p> There are three general components to the allocator: a datum <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Design Issues</title><meta name="generator" content="DocBook XSL Stylesheets Vsnapshot" /><meta name="keywords" content="ISO C++, allocator" /><meta name="keywords" content="ISO C++, library" /><meta name="keywords" content="ISO C++, runtime, library" /><link rel="home" href="../index.html" title="The GNU C++ Library" /><link rel="up" href="mt_allocator.html" title="Chapter 19. The mt_allocator" /><link rel="prev" href="mt_allocator.html" title="Chapter 19. The mt_allocator" /><link rel="next" href="mt_allocator_impl.html" title="Implementation" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Design Issues</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="mt_allocator.html">Prev</a> </td><th width="60%" align="center">Chapter 19. The mt_allocator</th><td width="20%" align="right"> <a accesskey="n" href="mt_allocator_impl.html">Next</a></td></tr></table><hr /></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="allocator.mt.design_issues"></a>Design Issues</h2></div></div></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="allocator.mt.overview"></a>Overview</h3></div></div></div><p> There are three general components to the allocator: a datum
describing the characteristics of the memory pool, a policy class describing the characteristics of the memory pool, a policy class
containing this pool that links instantiation types to common or containing this pool that links instantiation types to common or
individual pools, and a class inheriting from the policy class that is individual pools, and a class inheriting from the policy class that is
...@@ -35,4 +35,4 @@ tuning, for instance. ...@@ -35,4 +35,4 @@ tuning, for instance.
</pre><p> This class has the interface required for standard library allocator </pre><p> This class has the interface required for standard library allocator
classes, namely member functions <code class="code">allocate</code> and classes, namely member functions <code class="code">allocate</code> and
<code class="code">deallocate</code>, plus others. <code class="code">deallocate</code>, plus others.
</p></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="mt_allocator.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="mt_allocator.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="mt_allocator_impl.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Chapter 20. The mt_allocator </td><td width="20%" align="center"><a accesskey="h" href="../index.html">Home</a></td><td width="40%" align="right" valign="top"> Implementation</td></tr></table></div></body></html> </p></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="mt_allocator.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="mt_allocator.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="mt_allocator_impl.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Chapter 19. The mt_allocator </td><td width="20%" align="center"><a accesskey="h" href="../index.html">Home</a></td><td width="40%" align="right" valign="top"> Implementation</td></tr></table></div></body></html>
\ No newline at end of file \ No newline at end of file
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Multiple Thread Example</title><meta name="generator" content="DocBook XSL Stylesheets Vsnapshot" /><meta name="keywords" content="ISO C++, allocator" /><meta name="keywords" content="ISO C++, library" /><meta name="keywords" content="ISO C++, runtime, library" /><link rel="home" href="../index.html" title="The GNU C++ Library" /><link rel="up" href="mt_allocator.html" title="Chapter 20. The mt_allocator" /><link rel="prev" href="mt_allocator_ex_single.html" title="Single Thread Example" /><link rel="next" href="bitmap_allocator.html" title="Chapter 21. The bitmap_allocator" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Multiple Thread Example</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="mt_allocator_ex_single.html">Prev</a> </td><th width="60%" align="center">Chapter 20. The mt_allocator</th><td width="20%" align="right"> <a accesskey="n" href="bitmap_allocator.html">Next</a></td></tr></table><hr /></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="allocator.mt.example_multi"></a>Multiple Thread Example</h2></div></div></div><p> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Multiple Thread Example</title><meta name="generator" content="DocBook XSL Stylesheets Vsnapshot" /><meta name="keywords" content="ISO C++, allocator" /><meta name="keywords" content="ISO C++, library" /><meta name="keywords" content="ISO C++, runtime, library" /><link rel="home" href="../index.html" title="The GNU C++ Library" /><link rel="up" href="mt_allocator.html" title="Chapter 19. The mt_allocator" /><link rel="prev" href="mt_allocator_ex_single.html" title="Single Thread Example" /><link rel="next" href="bitmap_allocator.html" title="Chapter 20. The bitmap_allocator" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Multiple Thread Example</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="mt_allocator_ex_single.html">Prev</a> </td><th width="60%" align="center">Chapter 19. The mt_allocator</th><td width="20%" align="right"> <a accesskey="n" href="bitmap_allocator.html">Next</a></td></tr></table><hr /></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="allocator.mt.example_multi"></a>Multiple Thread Example</h2></div></div></div><p>
In the ST example we never used the thread_id variable present in each block. In the ST example we never used the thread_id variable present in each block.
Let's start by explaining the purpose of this in a MT application. Let's start by explaining the purpose of this in a MT application.
</p><p> </p><p>
...@@ -103,4 +103,4 @@ mutex to be locked) this operation is also made in chunks of blocks ...@@ -103,4 +103,4 @@ mutex to be locked) this operation is also made in chunks of blocks
a threads freelist mentioned above). The "formula" used can probably a threads freelist mentioned above). The "formula" used can probably
be improved to further reduce the risk of blocks being "bounced back be improved to further reduce the risk of blocks being "bounced back
and forth" between freelists. and forth" between freelists.
</p></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="mt_allocator_ex_single.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="mt_allocator.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="bitmap_allocator.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Single Thread Example </td><td width="20%" align="center"><a accesskey="h" href="../index.html">Home</a></td><td width="40%" align="right" valign="top"> Chapter 21. The bitmap_allocator</td></tr></table></div></body></html> </p></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="mt_allocator_ex_single.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="mt_allocator.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="bitmap_allocator.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Single Thread Example </td><td width="20%" align="center"><a accesskey="h" href="../index.html">Home</a></td><td width="40%" align="right" valign="top"> Chapter 20. The bitmap_allocator</td></tr></table></div></body></html>
\ No newline at end of file \ No newline at end of file
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Single Thread Example</title><meta name="generator" content="DocBook XSL Stylesheets Vsnapshot" /><meta name="keywords" content="ISO C++, allocator" /><meta name="keywords" content="ISO C++, library" /><meta name="keywords" content="ISO C++, runtime, library" /><link rel="home" href="../index.html" title="The GNU C++ Library" /><link rel="up" href="mt_allocator.html" title="Chapter 20. The mt_allocator" /><link rel="prev" href="mt_allocator_impl.html" title="Implementation" /><link rel="next" href="mt_allocator_ex_multi.html" title="Multiple Thread Example" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Single Thread Example</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="mt_allocator_impl.html">Prev</a> </td><th width="60%" align="center">Chapter 20. The mt_allocator</th><td width="20%" align="right"> <a accesskey="n" href="mt_allocator_ex_multi.html">Next</a></td></tr></table><hr /></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="allocator.mt.example_single"></a>Single Thread Example</h2></div></div></div><p> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Single Thread Example</title><meta name="generator" content="DocBook XSL Stylesheets Vsnapshot" /><meta name="keywords" content="ISO C++, allocator" /><meta name="keywords" content="ISO C++, library" /><meta name="keywords" content="ISO C++, runtime, library" /><link rel="home" href="../index.html" title="The GNU C++ Library" /><link rel="up" href="mt_allocator.html" title="Chapter 19. The mt_allocator" /><link rel="prev" href="mt_allocator_impl.html" title="Implementation" /><link rel="next" href="mt_allocator_ex_multi.html" title="Multiple Thread Example" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Single Thread Example</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="mt_allocator_impl.html">Prev</a> </td><th width="60%" align="center">Chapter 19. The mt_allocator</th><td width="20%" align="right"> <a accesskey="n" href="mt_allocator_ex_multi.html">Next</a></td></tr></table><hr /></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="allocator.mt.example_single"></a>Single Thread Example</h2></div></div></div><p>
Let's start by describing how the data on a freelist is laid out in memory. Let's start by describing how the data on a freelist is laid out in memory.
This is the first two blocks in freelist for thread id 3 in bin 3 (8 bytes): This is the first two blocks in freelist for thread id 3 in bin 3 (8 bytes):
</p><pre class="programlisting"> </p><pre class="programlisting">
......
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Implementation</title><meta name="generator" content="DocBook XSL Stylesheets Vsnapshot" /><meta name="keywords" content="ISO C++, allocator" /><meta name="keywords" content="ISO C++, library" /><meta name="keywords" content="ISO C++, runtime, library" /><link rel="home" href="../index.html" title="The GNU C++ Library" /><link rel="up" href="mt_allocator.html" title="Chapter 20. The mt_allocator" /><link rel="prev" href="mt_allocator_design.html" title="Design Issues" /><link rel="next" href="mt_allocator_ex_single.html" title="Single Thread Example" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Implementation</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="mt_allocator_design.html">Prev</a> </td><th width="60%" align="center">Chapter 20. The mt_allocator</th><td width="20%" align="right"> <a accesskey="n" href="mt_allocator_ex_single.html">Next</a></td></tr></table><hr /></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="allocator.mt.impl"></a>Implementation</h2></div></div></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="allocator.mt.tune"></a>Tunable Parameters</h3></div></div></div><p>Certain allocation parameters can be modified, or tuned. There <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Implementation</title><meta name="generator" content="DocBook XSL Stylesheets Vsnapshot" /><meta name="keywords" content="ISO C++, allocator" /><meta name="keywords" content="ISO C++, library" /><meta name="keywords" content="ISO C++, runtime, library" /><link rel="home" href="../index.html" title="The GNU C++ Library" /><link rel="up" href="mt_allocator.html" title="Chapter 19. The mt_allocator" /><link rel="prev" href="mt_allocator_design.html" title="Design Issues" /><link rel="next" href="mt_allocator_ex_single.html" title="Single Thread Example" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Implementation</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="mt_allocator_design.html">Prev</a> </td><th width="60%" align="center">Chapter 19. The mt_allocator</th><td width="20%" align="right"> <a accesskey="n" href="mt_allocator_ex_single.html">Next</a></td></tr></table><hr /></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="allocator.mt.impl"></a>Implementation</h2></div></div></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="allocator.mt.tune"></a>Tunable Parameters</h3></div></div></div><p>Certain allocation parameters can be modified, or tuned. There
exists a nested <code class="code">struct __pool_base::_Tune</code> that contains all exists a nested <code class="code">struct __pool_base::_Tune</code> that contains all
these parameters, which include settings for these parameters, which include settings for
</p><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>Alignment</p></li><li class="listitem"><p>Maximum bytes before calling <code class="code">::operator new</code> directly</p></li><li class="listitem"><p>Minimum bytes</p></li><li class="listitem"><p>Size of underlying global allocations</p></li><li class="listitem"><p>Maximum number of supported threads</p></li><li class="listitem"><p>Migration of deallocations to the global free list</p></li><li class="listitem"><p>Shunt for global <code class="code">new</code> and <code class="code">delete</code></p></li></ul></div><p>Adjusting parameters for a given instance of an allocator can only </p><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>Alignment</p></li><li class="listitem"><p>Maximum bytes before calling <code class="code">::operator new</code> directly</p></li><li class="listitem"><p>Minimum bytes</p></li><li class="listitem"><p>Size of underlying global allocations</p></li><li class="listitem"><p>Maximum number of supported threads</p></li><li class="listitem"><p>Migration of deallocations to the global free list</p></li><li class="listitem"><p>Shunt for global <code class="code">new</code> and <code class="code">delete</code></p></li></ul></div><p>Adjusting parameters for a given instance of an allocator can only
......
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Testing</title><meta name="generator" content="DocBook XSL Stylesheets Vsnapshot" /><meta name="keywords" content="C++, library, parallel" /><meta name="keywords" content="ISO C++, library" /><meta name="keywords" content="ISO C++, runtime, library" /><link rel="home" href="../index.html" title="The GNU C++ Library" /><link rel="up" href="parallel_mode.html" title="Chapter 18. Parallel Mode" /><link rel="prev" href="parallel_mode_design.html" title="Design" /><link rel="next" href="profile_mode.html" title="Chapter 19. Profile Mode" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Testing</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="parallel_mode_design.html">Prev</a> </td><th width="60%" align="center">Chapter 18. Parallel Mode</th><td width="20%" align="right"> <a accesskey="n" href="profile_mode.html">Next</a></td></tr></table><hr /></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="manual.ext.parallel_mode.test"></a>Testing</h2></div></div></div><p> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Testing</title><meta name="generator" content="DocBook XSL Stylesheets Vsnapshot" /><meta name="keywords" content="C++, library, parallel" /><meta name="keywords" content="ISO C++, library" /><meta name="keywords" content="ISO C++, runtime, library" /><link rel="home" href="../index.html" title="The GNU C++ Library" /><link rel="up" href="parallel_mode.html" title="Chapter 18. Parallel Mode" /><link rel="prev" href="parallel_mode_design.html" title="Design" /><link rel="next" href="mt_allocator.html" title="Chapter 19. The mt_allocator" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Testing</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="parallel_mode_design.html">Prev</a> </td><th width="60%" align="center">Chapter 18. Parallel Mode</th><td width="20%" align="right"> <a accesskey="n" href="mt_allocator.html">Next</a></td></tr></table><hr /></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="manual.ext.parallel_mode.test"></a>Testing</h2></div></div></div><p>
Both the normal conformance and regression tests and the Both the normal conformance and regression tests and the
supplemental performance tests work. supplemental performance tests work.
</p><p> </p><p>
...@@ -22,4 +22,4 @@ ...@@ -22,4 +22,4 @@
additional software dependencies than the usual bare-boned text additional software dependencies than the usual bare-boned text
file, and can be generated by using the <code class="code">make file, and can be generated by using the <code class="code">make
doc-performance</code> rule in the testsuite's Makefile. doc-performance</code> rule in the testsuite's Makefile.
</p></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="parallel_mode_design.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="parallel_mode.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="profile_mode.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Design </td><td width="20%" align="center"><a accesskey="h" href="../index.html">Home</a></td><td width="40%" align="right" valign="top"> Chapter 19. Profile Mode</td></tr></table></div></body></html> </p></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="parallel_mode_design.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="parallel_mode.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="mt_allocator.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Design </td><td width="20%" align="center"><a accesskey="h" href="../index.html">Home</a></td><td width="40%" align="right" valign="top"> Chapter 19. The mt_allocator</td></tr></table></div></body></html>
\ No newline at end of file \ No newline at end of file
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Testing</title><meta name="generator" content="DocBook XSL Stylesheets Vsnapshot" /><meta name="keywords" content="ISO C++, policy, container, data, structure, associated, tree, trie, hash, metaprogramming" /><meta name="keywords" content="ISO C++, library" /><meta name="keywords" content="ISO C++, runtime, library" /><link rel="home" href="../index.html" title="The GNU C++ Library" /><link rel="up" href="policy_data_structures.html" title="Chapter 22. Policy-Based Data Structures" /><link rel="prev" href="policy_data_structures_design.html" title="Design" /><link rel="next" href="policy_data_structures_ack.html" title="Acknowledgments" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Testing</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="policy_data_structures_design.html">Prev</a> </td><th width="60%" align="center">Chapter 22. Policy-Based Data Structures</th><td width="20%" align="right"> <a accesskey="n" href="policy_data_structures_ack.html">Next</a></td></tr></table><hr /></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="pbds.test"></a>Testing</h2></div></div></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="pbds.test.regression"></a>Regression</h3></div></div></div><p>The library contains a single comprehensive regression test. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Testing</title><meta name="generator" content="DocBook XSL Stylesheets Vsnapshot" /><meta name="keywords" content="ISO C++, policy, container, data, structure, associated, tree, trie, hash, metaprogramming" /><meta name="keywords" content="ISO C++, library" /><meta name="keywords" content="ISO C++, runtime, library" /><link rel="home" href="../index.html" title="The GNU C++ Library" /><link rel="up" href="policy_data_structures.html" title="Chapter 21. Policy-Based Data Structures" /><link rel="prev" href="policy_data_structures_design.html" title="Design" /><link rel="next" href="policy_data_structures_ack.html" title="Acknowledgments" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Testing</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="policy_data_structures_design.html">Prev</a> </td><th width="60%" align="center">Chapter 21. Policy-Based Data Structures</th><td width="20%" align="right"> <a accesskey="n" href="policy_data_structures_ack.html">Next</a></td></tr></table><hr /></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="pbds.test"></a>Testing</h2></div></div></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="pbds.test.regression"></a>Regression</h3></div></div></div><p>The library contains a single comprehensive regression test.
For a given container type in this library, the test creates For a given container type in this library, the test creates
an object of the container type and an object of the an object of the container type and an object of the
corresponding standard type (e.g., <code class="classname">std::set</code>). It corresponding standard type (e.g., <code class="classname">std::set</code>). It
......
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Acknowledgments</title><meta name="generator" content="DocBook XSL Stylesheets Vsnapshot" /><meta name="keywords" content="ISO C++, policy, container, data, structure, associated, tree, trie, hash, metaprogramming" /><meta name="keywords" content="ISO C++, library" /><meta name="keywords" content="ISO C++, runtime, library" /><link rel="home" href="../index.html" title="The GNU C++ Library" /><link rel="up" href="policy_data_structures.html" title="Chapter 22. Policy-Based Data Structures" /><link rel="prev" href="policy_based_data_structures_test.html" title="Testing" /><link rel="next" href="ext_containers.html" title="Chapter 23. HP/SGI Extensions" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Acknowledgments</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="policy_based_data_structures_test.html">Prev</a> </td><th width="60%" align="center">Chapter 22. Policy-Based Data Structures</th><td width="20%" align="right"> <a accesskey="n" href="ext_containers.html">Next</a></td></tr></table><hr /></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="pbds.ack"></a>Acknowledgments</h2></div></div></div><p> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Acknowledgments</title><meta name="generator" content="DocBook XSL Stylesheets Vsnapshot" /><meta name="keywords" content="ISO C++, policy, container, data, structure, associated, tree, trie, hash, metaprogramming" /><meta name="keywords" content="ISO C++, library" /><meta name="keywords" content="ISO C++, runtime, library" /><link rel="home" href="../index.html" title="The GNU C++ Library" /><link rel="up" href="policy_data_structures.html" title="Chapter 21. Policy-Based Data Structures" /><link rel="prev" href="policy_based_data_structures_test.html" title="Testing" /><link rel="next" href="ext_containers.html" title="Chapter 22. HP/SGI Extensions" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Acknowledgments</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="policy_based_data_structures_test.html">Prev</a> </td><th width="60%" align="center">Chapter 21. Policy-Based Data Structures</th><td width="20%" align="right"> <a accesskey="n" href="ext_containers.html">Next</a></td></tr></table><hr /></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="pbds.ack"></a>Acknowledgments</h2></div></div></div><p>
Written by Ami Tavory and Vladimir Dreizin (IBM Haifa Research Written by Ami Tavory and Vladimir Dreizin (IBM Haifa Research
Laboratories), and Benjamin Kosnik (Red Hat). Laboratories), and Benjamin Kosnik (Red Hat).
</p><p> </p><p>
...@@ -24,4 +24,4 @@ ...@@ -24,4 +24,4 @@
attributing to him any flaws in the design or implementation of the attributing to him any flaws in the design or implementation of the
library). library).
</p><p>We would like to thank Matt Austern for the suggestion to </p><p>We would like to thank Matt Austern for the suggestion to
include tries.</p></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="policy_based_data_structures_test.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="policy_data_structures.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="ext_containers.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Testing </td><td width="20%" align="center"><a accesskey="h" href="../index.html">Home</a></td><td width="40%" align="right" valign="top"> Chapter 23. HP/SGI Extensions</td></tr></table></div></body></html> include tries.</p></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="policy_based_data_structures_test.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="policy_data_structures.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="ext_containers.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Testing </td><td width="20%" align="center"><a accesskey="h" href="../index.html">Home</a></td><td width="40%" align="right" valign="top"> Chapter 22. HP/SGI Extensions</td></tr></table></div></body></html>
\ No newline at end of file \ No newline at end of file
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Using</title><meta name="generator" content="DocBook XSL Stylesheets Vsnapshot" /><meta name="keywords" content="ISO C++, policy, container, data, structure, associated, tree, trie, hash, metaprogramming" /><meta name="keywords" content="ISO C++, library" /><meta name="keywords" content="ISO C++, runtime, library" /><link rel="home" href="../index.html" title="The GNU C++ Library" /><link rel="up" href="policy_data_structures.html" title="Chapter 22. Policy-Based Data Structures" /><link rel="prev" href="policy_data_structures.html" title="Chapter 22. Policy-Based Data Structures" /><link rel="next" href="policy_data_structures_design.html" title="Design" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Using</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="policy_data_structures.html">Prev</a> </td><th width="60%" align="center">Chapter 22. Policy-Based Data Structures</th><td width="20%" align="right"> <a accesskey="n" href="policy_data_structures_design.html">Next</a></td></tr></table><hr /></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="containers.pbds.using"></a>Using</h2></div></div></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="pbds.using.prereq"></a>Prerequisites</h3></div></div></div><p>The library contains only header files, and does not require any <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Using</title><meta name="generator" content="DocBook XSL Stylesheets Vsnapshot" /><meta name="keywords" content="ISO C++, policy, container, data, structure, associated, tree, trie, hash, metaprogramming" /><meta name="keywords" content="ISO C++, library" /><meta name="keywords" content="ISO C++, runtime, library" /><link rel="home" href="../index.html" title="The GNU C++ Library" /><link rel="up" href="policy_data_structures.html" title="Chapter 21. Policy-Based Data Structures" /><link rel="prev" href="policy_data_structures.html" title="Chapter 21. Policy-Based Data Structures" /><link rel="next" href="policy_data_structures_design.html" title="Design" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Using</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="policy_data_structures.html">Prev</a> </td><th width="60%" align="center">Chapter 21. Policy-Based Data Structures</th><td width="20%" align="right"> <a accesskey="n" href="policy_data_structures_design.html">Next</a></td></tr></table><hr /></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="containers.pbds.using"></a>Using</h2></div></div></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="pbds.using.prereq"></a>Prerequisites</h3></div></div></div><p>The library contains only header files, and does not require any
other libraries except the standard C++ library . All classes are other libraries except the standard C++ library . All classes are
defined in namespace <code class="code">__gnu_pbds</code>. The library internally defined in namespace <code class="code">__gnu_pbds</code>. The library internally
uses macros beginning with <code class="code">PB_DS</code>, but uses macros beginning with <code class="code">PB_DS</code>, but
...@@ -61,7 +61,7 @@ ...@@ -61,7 +61,7 @@
In addition, there are the following diagnostics classes, In addition, there are the following diagnostics classes,
used to report errors specific to this library's data used to report errors specific to this library's data
structures. structures.
</p><div class="figure"><a id="id-1.3.5.9.3.3.6"></a><p class="title"><strong>Figure 22.7. Exception Hierarchy</strong></p><div class="figure-contents"><div class="mediaobject" align="center"><img src="../images/pbds_exception_hierarchy.png" align="middle" alt="Exception Hierarchy" /></div></div></div><br class="figure-break" /></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="pbds.using.tutorial"></a>Tutorial</h3></div></div></div><div class="section"><div class="titlepage"><div><div><h4 class="title"><a id="pbds.using.tutorial.basic"></a>Basic Use</h4></div></div></div><p> </p><div class="figure"><a id="id-1.3.5.8.3.3.6"></a><p class="title"><strong>Figure 21.7. Exception Hierarchy</strong></p><div class="figure-contents"><div class="mediaobject" align="center"><img src="../images/pbds_exception_hierarchy.png" align="middle" alt="Exception Hierarchy" /></div></div></div><br class="figure-break" /></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="pbds.using.tutorial"></a>Tutorial</h3></div></div></div><div class="section"><div class="titlepage"><div><div><h4 class="title"><a id="pbds.using.tutorial.basic"></a>Basic Use</h4></div></div></div><p>
For the most part, the policy-based containers containers in For the most part, the policy-based containers containers in
namespace <code class="literal">__gnu_pbds</code> have the same interface as namespace <code class="literal">__gnu_pbds</code> have the same interface as
the equivalent containers in the standard C++ library, except for the equivalent containers in the standard C++ library, except for
...@@ -479,4 +479,4 @@ ...@@ -479,4 +479,4 @@
very simple version of Dijkstra's shortest path very simple version of Dijkstra's shortest path
algorithm: algorithm:
<code class="filename">priority_queue_dijkstra.cc</code> <code class="filename">priority_queue_dijkstra.cc</code>
</p></li></ul></div></div></div></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="policy_data_structures.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="policy_data_structures.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="policy_data_structures_design.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Chapter 22. Policy-Based Data Structures </td><td width="20%" align="center"><a accesskey="h" href="../index.html">Home</a></td><td width="40%" align="right" valign="top"> Design</td></tr></table></div></body></html> </p></li></ul></div></div></div></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="policy_data_structures.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="policy_data_structures.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="policy_data_structures_design.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Chapter 21. Policy-Based Data Structures </td><td width="20%" align="center"><a accesskey="h" href="../index.html">Home</a></td><td width="40%" align="right" valign="top"> Design</td></tr></table></div></body></html>
\ No newline at end of file \ No newline at end of file
...@@ -45,10 +45,8 @@ It has subdirectories: ...@@ -45,10 +45,8 @@ It has subdirectories:
</dd><dt><span class="term"> </dd><dt><span class="term">
<code class="filename">include/debug</code>, <code class="filename">include/debug</code>,
<code class="filename">include/parallel</code>, and <code class="filename">include/parallel</code>, and
<code class="filename">include/profile</code>
</span></dt><dd> </span></dt><dd>
Headers that implement the Debug Mode, Parallel Mode, and Profile Mode Headers that implement the Debug Mode and Parallel Mode extensions.
extensions.
</dd></dl></div></dd><dt><span class="term"><code class="filename">scripts</code></span></dt><dd> </dd></dl></div></dd><dt><span class="term"><code class="filename">scripts</code></span></dt><dd>
Scripts that are used during the configure, build, make, or test Scripts that are used during the configure, build, make, or test
process. process.
......
...@@ -91,7 +91,7 @@ particular release. ...@@ -91,7 +91,7 @@ particular release.
<code class="code">std::type_info::name()</code> is the mangled type name. <code class="code">std::type_info::name()</code> is the mangled type name.
You will need to call <code class="code">c++filt</code> and pass the names as You will need to call <code class="code">c++filt</code> and pass the names as
command-line parameters to demangle them, or call a command-line parameters to demangle them, or call a
<a class="link" href="ext_demangling.html" title="Chapter 29. Demangling">runtime demangler function</a>. <a class="link" href="ext_demangling.html" title="Chapter 28. Demangling">runtime demangler function</a>.
</p><p><span class="emphasis"><em>[20.1.5]/5</em></span> <span class="emphasis"><em>"Implementors are encouraged to </p><p><span class="emphasis"><em>[20.1.5]/5</em></span> <span class="emphasis"><em>"Implementors are encouraged to
supply libraries that can accept allocators that encapsulate more supply libraries that can accept allocators that encapsulate more
general memory models and that support non-equal instances. In such general memory models and that support non-equal instances. In such
...@@ -1238,7 +1238,9 @@ Feature-testing recommendations for C++</a>. ...@@ -1238,7 +1238,9 @@ Feature-testing recommendations for C++</a>.
<a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0591r4.pdf" target="_top"> <a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0591r4.pdf" target="_top">
P0591R4 P0591R4
</a> </a>
</td><td align="center"> 9.1 </td><td align="left"> </td></tr><tr><td align="left"> P0595R2 <code class="code">std::is_constant_evaluated()</code> </td><td align="left"> </td><td align="center"> 9.1 </td><td align="left">
<code class="code">std::scoped_allocator_adaptor</code> changes missing in 9.1.0
</td></tr><tr><td align="left"> P0595R2 <code class="code">std::is_constant_evaluated()</code> </td><td align="left">
<a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0595r2.html" target="_top"> <a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0595r2.html" target="_top">
P0595R2 P0595R2
</a> </a>
......
...@@ -533,10 +533,7 @@ with specific options, and additional options for 32-bit x86: ...@@ -533,10 +533,7 @@ with specific options, and additional options for 32-bit x86:
(as determined by the <code class="literal">_GLIBCXX_DEBUG</code> macro). (as determined by the <code class="literal">_GLIBCXX_DEBUG</code> macro).
</p></dd><dt><span class="term"><code class="literal">dg-require-parallel-mode ""</code></span></dt><dd><p>Skip the test if the Parallel Mode is not active </p></dd><dt><span class="term"><code class="literal">dg-require-parallel-mode ""</code></span></dt><dd><p>Skip the test if the Parallel Mode is not active
(as determined by the <code class="literal">_GLIBCXX_PARALLEL</code> macro). (as determined by the <code class="literal">_GLIBCXX_PARALLEL</code> macro).
</p></dd><dt><span class="term"><code class="literal">dg-require-profile-mode ""</code></span></dt><dd><p>Skip the test if the Profile Mode is not active </p></dd><dt><span class="term"><code class="literal">dg-require-normal-mode ""</code></span></dt><dd><p>Skip the test if Debug or Parallel Mode is active.
(as determined by the <code class="literal">_GLIBCXX_PROFILE</code> macro).
</p></dd><dt><span class="term"><code class="literal">dg-require-normal-mode ""</code></span></dt><dd><p>Skip the test if any of Debug, Parallel or Profile
Mode is active.
</p></dd><dt><span class="term"><code class="literal">dg-require-atomic-builtins ""</code></span></dt><dd><p>Skip the test if atomic operations on <span class="type">bool</span> </p></dd><dt><span class="term"><code class="literal">dg-require-atomic-builtins ""</code></span></dt><dd><p>Skip the test if atomic operations on <span class="type">bool</span>
and <span class="type">int</span> are not lock-free. and <span class="type">int</span> are not lock-free.
</p></dd><dt><span class="term"><code class="literal">dg-require-gthreads ""</code></span></dt><dd><p>Skip the test if the C++11 thread library is not </p></dd><dt><span class="term"><code class="literal">dg-require-gthreads ""</code></span></dt><dd><p>Skip the test if the C++11 thread library is not
......
...@@ -103,9 +103,6 @@ ...@@ -103,9 +103,6 @@
<code class="code">_GLIBCXX_ASSERTIONS</code> has a non-zero value, otherwise to zero. <code class="code">_GLIBCXX_ASSERTIONS</code> has a non-zero value, otherwise to zero.
When defined to a non-zero value, it enables extra error checking and When defined to a non-zero value, it enables extra error checking and
assertions in the parallel mode. assertions in the parallel mode.
</p></dd><dt><span class="term"><code class="code">_GLIBCXX_PROFILE</code></span></dt><dd><p>Undefined by default. When defined, compiles user code
using the <a class="link" href="profile_mode.html" title="Chapter 19. Profile Mode">profile
mode</a>.
</p></dd><dt><span class="term"><code class="code">__STDCPP_WANT_MATH_SPEC_FUNCS__</code></span></dt><dd><p>Undefined by default. When defined to a non-zero integer constant, </p></dd><dt><span class="term"><code class="code">__STDCPP_WANT_MATH_SPEC_FUNCS__</code></span></dt><dd><p>Undefined by default. When defined to a non-zero integer constant,
enables support for ISO/IEC 29124 Special Math Functions. enables support for ISO/IEC 29124 Special Math Functions.
</p></dd><dt><span class="term"><code class="code">_GLIBCXX_SANITIZE_VECTOR</code></span></dt><dd><p> </p></dd><dt><span class="term"><code class="code">_GLIBCXX_SANITIZE_VECTOR</code></span></dt><dd><p>
......
...@@ -92,12 +92,6 @@ ...@@ -92,12 +92,6 @@
</para> </para>
</personblurb></author> </personblurb></author>
<author><personname><firstname>Silvius</firstname><surname>Rus</surname></personname><personblurb>
<para>
Profile mode
</para>
</personblurb></author>
<author><personname><firstname>Johannes</firstname><surname>Singler</surname></personname><personblurb> <author><personname><firstname>Johannes</firstname><surname>Singler</surname></personname><personblurb>
<para> <para>
Parallel mode Parallel mode
......
...@@ -292,11 +292,9 @@ It has subdirectories: ...@@ -292,11 +292,9 @@ It has subdirectories:
<term> <term>
<filename class="directory">include/debug</filename>, <filename class="directory">include/debug</filename>,
<filename class="directory">include/parallel</filename>, and <filename class="directory">include/parallel</filename>, and
<filename class="directory">include/profile</filename>
</term> </term>
<listitem> <listitem>
Headers that implement the Debug Mode, Parallel Mode, and Profile Mode Headers that implement the Debug Mode and Parallel Mode extensions.
extensions.
</listitem> </listitem>
</varlistentry> </varlistentry>
</variablelist> </variablelist>
......
...@@ -354,12 +354,4 @@ ...@@ -354,12 +354,4 @@
</para> </para>
</section> </section>
<section xml:id="debug.profile_mode" xreflabel="debug.profile_mode"><info><title>Profile-based Performance Analysis</title></info>
<para> The <link linkend="manual.ext.profile_mode">Profile-based
Performance Analysis</link> extension has performance checks for many
algorithms.
</para>
</section>
</section> </section>
...@@ -948,7 +948,13 @@ now defaults to zero. ...@@ -948,7 +948,13 @@ now defaults to zero.
</section> </section>
<section xml:id="api.rel_101"><info><title><constant>10</constant></title></info> <section xml:id="api.rel_101"><info><title><constant>10</constant></title></info>
<para> <classname>__gnu_cxx::array_allocator</classname> removed. </para> <para> Deprecated features removed:
<itemizedlist>
<listitem> Profile Mode </listitem>
<listitem> <classname>__gnu_cxx::array_allocator</classname> </listitem>
</itemizedlist>
</para>
</section> </section>
</section> </section>
...@@ -107,12 +107,6 @@ extensions, be aware of two things: ...@@ -107,12 +107,6 @@ extensions, be aware of two things:
href="parallel_mode.xml"> href="parallel_mode.xml">
</xi:include> </xi:include>
<!-- Chapter 04 : Profile Mode -->
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" parse="xml"
href="profile_mode.xml">
</xi:include>
<!-- XXX --> <!-- XXX -->
<!-- Allocators --> <!-- Allocators -->
<!-- Chapter 05 : __mt_alloc --> <!-- Chapter 05 : __mt_alloc -->
......
...@@ -126,12 +126,6 @@ ...@@ -126,12 +126,6 @@
</para> </para>
</personblurb></author> </personblurb></author>
<author><personname><firstname>Silvius</firstname><surname>Rus</surname></personname><personblurb>
<para>
Profile mode
</para>
</personblurb></author>
<author><personname><firstname>Johannes</firstname><surname>Singler</surname></personname><personblurb> <author><personname><firstname>Johannes</firstname><surname>Singler</surname></personname><personblurb>
<para> <para>
Parallel mode Parallel mode
......
...@@ -857,14 +857,8 @@ with specific options, and additional options for 32-bit x86: ...@@ -857,14 +857,8 @@ with specific options, and additional options for 32-bit x86:
(as determined by the <literal>_GLIBCXX_PARALLEL</literal> macro). (as determined by the <literal>_GLIBCXX_PARALLEL</literal> macro).
</para></listitem> </para></listitem>
</varlistentry> </varlistentry>
<varlistentry><term><literal>dg-require-profile-mode ""</literal></term>
<listitem><para>Skip the test if the Profile Mode is not active
(as determined by the <literal>_GLIBCXX_PROFILE</literal> macro).
</para></listitem>
</varlistentry>
<varlistentry><term><literal>dg-require-normal-mode ""</literal></term> <varlistentry><term><literal>dg-require-normal-mode ""</literal></term>
<listitem><para>Skip the test if any of Debug, Parallel or Profile <listitem><para>Skip the test if Debug or Parallel Mode is active.
Mode is active.
</para></listitem> </para></listitem>
</varlistentry> </varlistentry>
<varlistentry><term><literal>dg-require-atomic-builtins ""</literal></term> <varlistentry><term><literal>dg-require-atomic-builtins ""</literal></term>
......
...@@ -804,36 +804,6 @@ compiler supports scalar decimal floating-point types defined via ...@@ -804,36 +804,6 @@ compiler supports scalar decimal floating-point types defined via
<para/> <para/>
<table frame="all" xml:id="table.profile_headers">
<title>Extension Profile Headers</title>
<tgroup cols="4" align="left" colsep="1" rowsep="1">
<colspec colname="c1"/>
<colspec colname="c2"/>
<colspec colname="c3"/>
<colspec colname="c4"/>
<tbody>
<row>
<entry><filename class="headerfile">profile/bitset</filename></entry>
<entry><filename class="headerfile">profile/deque</filename></entry>
<entry><filename class="headerfile">profile/list</filename></entry>
<entry><filename class="headerfile">profile/map</filename></entry>
</row>
<row>
<entry><filename class="headerfile">profile/set</filename></entry>
<entry><filename class="headerfile">profile/unordered_map</filename></entry>
<entry><filename class="headerfile">profile/unordered_set</filename></entry>
<entry><filename class="headerfile">profile/vector</filename></entry>
</row>
</tbody>
</tgroup>
</table>
<para/>
<table frame="all" xml:id="table.parallel_headers"> <table frame="all" xml:id="table.parallel_headers">
<title>Extension Parallel Headers</title> <title>Extension Parallel Headers</title>
...@@ -1175,14 +1145,6 @@ g++ -Winvalid-pch -I. -include stdc++.h -H -g -O2 hello.cc -o test.exe ...@@ -1175,14 +1145,6 @@ g++ -Winvalid-pch -I. -include stdc++.h -H -g -O2 hello.cc -o test.exe
</para> </para>
</listitem></varlistentry> </listitem></varlistentry>
<varlistentry><term><code>_GLIBCXX_PROFILE</code></term>
<listitem>
<para>Undefined by default. When defined, compiles user code
using the <link linkend="manual.ext.profile_mode">profile
mode</link>.
</para>
</listitem></varlistentry>
<varlistentry><term><code>__STDCPP_WANT_MATH_SPEC_FUNCS__</code></term> <varlistentry><term><code>__STDCPP_WANT_MATH_SPEC_FUNCS__</code></term>
<listitem> <listitem>
<para>Undefined by default. When defined to a non-zero integer constant, <para>Undefined by default. When defined to a non-zero integer constant,
......
...@@ -919,45 +919,6 @@ parallel_headers = \ ...@@ -919,45 +919,6 @@ parallel_headers = \
${parallel_srcdir}/unique_copy.h \ ${parallel_srcdir}/unique_copy.h \
${parallel_srcdir}/workstealing.h ${parallel_srcdir}/workstealing.h
# Profile mode headers
profile_srcdir = ${glibcxx_srcdir}/include/profile
profile_builddir = ./profile
profile_headers = \
${profile_srcdir}/array \
${profile_srcdir}/base.h \
${profile_srcdir}/unordered_base.h \
${profile_srcdir}/unordered_map \
${profile_srcdir}/unordered_set \
${profile_srcdir}/vector \
${profile_srcdir}/bitset \
${profile_srcdir}/deque \
${profile_srcdir}/forward_list \
${profile_srcdir}/list \
${profile_srcdir}/map \
${profile_srcdir}/map.h \
${profile_srcdir}/multimap.h \
${profile_srcdir}/multiset.h \
${profile_srcdir}/ordered_base.h \
${profile_srcdir}/set \
${profile_srcdir}/set.h \
${profile_srcdir}/iterator_tracker.h
profile_impl_srcdir = ${glibcxx_srcdir}/include/profile/impl
profile_impl_builddir = ./profile/impl
profile_impl_headers = \
${profile_impl_srcdir}/profiler.h \
${profile_impl_srcdir}/profiler_algos.h \
${profile_impl_srcdir}/profiler_container_size.h \
${profile_impl_srcdir}/profiler_hash_func.h \
${profile_impl_srcdir}/profiler_hashtable_size.h \
${profile_impl_srcdir}/profiler_map_to_unordered_map.h \
${profile_impl_srcdir}/profiler_node.h \
${profile_impl_srcdir}/profiler_state.h \
${profile_impl_srcdir}/profiler_trace.h \
${profile_impl_srcdir}/profiler_vector_size.h \
${profile_impl_srcdir}/profiler_vector_to_list.h \
${profile_impl_srcdir}/profiler_list_to_vector.h \
${profile_impl_srcdir}/profiler_list_to_slist.h
# Some "C" header schemes require the "C" compatibility headers. # Some "C" header schemes require the "C" compatibility headers.
# For --enable-cheaders=c_std # For --enable-cheaders=c_std
if GLIBCXX_C_HEADERS_COMPATIBILITY if GLIBCXX_C_HEADERS_COMPATIBILITY
...@@ -1043,7 +1004,7 @@ allstamped = \ ...@@ -1043,7 +1004,7 @@ allstamped = \
stamp-std stamp-bits stamp-bits-sup stamp-pstl stamp-c_base stamp-c_compatibility \ stamp-std stamp-bits stamp-bits-sup stamp-pstl stamp-c_base stamp-c_compatibility \
stamp-backward stamp-ext stamp-pb stamp-tr1 stamp-tr2 stamp-decimal \ stamp-backward stamp-ext stamp-pb stamp-tr1 stamp-tr2 stamp-decimal \
stamp-experimental stamp-experimental-bits stamp-debug stamp-parallel \ stamp-experimental stamp-experimental-bits stamp-debug stamp-parallel \
stamp-profile stamp-profile-impl stamp-host stamp-host
# List of all files that are created by explicit building, editing, or # List of all files that are created by explicit building, editing, or
# catenation. # catenation.
...@@ -1191,16 +1152,6 @@ stamp-parallel: ${parallel_headers} ...@@ -1191,16 +1152,6 @@ stamp-parallel: ${parallel_headers}
@-cd ${parallel_builddir} && $(LN_S) $? . 2>/dev/null @-cd ${parallel_builddir} && $(LN_S) $? . 2>/dev/null
@$(STAMP) stamp-parallel @$(STAMP) stamp-parallel
stamp-profile: ${profile_headers}
@-mkdir -p ${profile_builddir}
@-cd ${profile_builddir} && $(LN_S) $? . 2>/dev/null
@$(STAMP) stamp-profile
stamp-profile-impl: ${profile_impl_headers}
@-mkdir -p ${profile_impl_builddir}
@-cd ${profile_impl_builddir} && $(LN_S) $? . 2>/dev/null
@$(STAMP) stamp-profile-impl
stamp-${host_alias}: stamp-${host_alias}:
@-mkdir -p ${host_builddir} @-mkdir -p ${host_builddir}
@-mkdir -p ${host_builddir}/../ext @-mkdir -p ${host_builddir}/../ext
...@@ -1498,12 +1449,6 @@ install-headers: ...@@ -1498,12 +1449,6 @@ install-headers:
$(mkinstalldirs) $(DESTDIR)${gxx_include_dir}/${parallel_builddir} $(mkinstalldirs) $(DESTDIR)${gxx_include_dir}/${parallel_builddir}
for file in ${parallel_headers}; do \ for file in ${parallel_headers}; do \
$(INSTALL_DATA) $${file} $(DESTDIR)${gxx_include_dir}/${parallel_builddir}; done $(INSTALL_DATA) $${file} $(DESTDIR)${gxx_include_dir}/${parallel_builddir}; done
$(mkinstalldirs) $(DESTDIR)${gxx_include_dir}/${profile_builddir}
for file in ${profile_headers}; do \
$(INSTALL_DATA) $${file} $(DESTDIR)${gxx_include_dir}/${profile_builddir}; done
$(mkinstalldirs) $(DESTDIR)${gxx_include_dir}/${profile_impl_builddir}
for file in ${profile_impl_headers}; do \
$(INSTALL_DATA) $${file} $(DESTDIR)${gxx_include_dir}/${profile_impl_builddir}; done
$(mkinstalldirs) $(DESTDIR)${host_installdir} $(mkinstalldirs) $(DESTDIR)${host_installdir}
for file in ${host_headers} ${bits_host_headers} ${host_headers_extra} \ for file in ${host_headers} ${bits_host_headers} ${host_headers_extra} \
${thread_host_headers}; do \ ${thread_host_headers}; do \
......
...@@ -1257,47 +1257,6 @@ parallel_headers = \ ...@@ -1257,47 +1257,6 @@ parallel_headers = \
${parallel_srcdir}/unique_copy.h \ ${parallel_srcdir}/unique_copy.h \
${parallel_srcdir}/workstealing.h ${parallel_srcdir}/workstealing.h
# Profile mode headers
profile_srcdir = ${glibcxx_srcdir}/include/profile
profile_builddir = ./profile
profile_headers = \
${profile_srcdir}/array \
${profile_srcdir}/base.h \
${profile_srcdir}/unordered_base.h \
${profile_srcdir}/unordered_map \
${profile_srcdir}/unordered_set \
${profile_srcdir}/vector \
${profile_srcdir}/bitset \
${profile_srcdir}/deque \
${profile_srcdir}/forward_list \
${profile_srcdir}/list \
${profile_srcdir}/map \
${profile_srcdir}/map.h \
${profile_srcdir}/multimap.h \
${profile_srcdir}/multiset.h \
${profile_srcdir}/ordered_base.h \
${profile_srcdir}/set \
${profile_srcdir}/set.h \
${profile_srcdir}/iterator_tracker.h
profile_impl_srcdir = ${glibcxx_srcdir}/include/profile/impl
profile_impl_builddir = ./profile/impl
profile_impl_headers = \
${profile_impl_srcdir}/profiler.h \
${profile_impl_srcdir}/profiler_algos.h \
${profile_impl_srcdir}/profiler_container_size.h \
${profile_impl_srcdir}/profiler_hash_func.h \
${profile_impl_srcdir}/profiler_hashtable_size.h \
${profile_impl_srcdir}/profiler_map_to_unordered_map.h \
${profile_impl_srcdir}/profiler_node.h \
${profile_impl_srcdir}/profiler_state.h \
${profile_impl_srcdir}/profiler_trace.h \
${profile_impl_srcdir}/profiler_vector_size.h \
${profile_impl_srcdir}/profiler_vector_to_list.h \
${profile_impl_srcdir}/profiler_list_to_vector.h \
${profile_impl_srcdir}/profiler_list_to_slist.h
@GLIBCXX_C_HEADERS_COMPATIBILITY_FALSE@c_compatibility_headers_extra = @GLIBCXX_C_HEADERS_COMPATIBILITY_FALSE@c_compatibility_headers_extra =
# Some "C" header schemes require the "C" compatibility headers. # Some "C" header schemes require the "C" compatibility headers.
...@@ -1376,7 +1335,7 @@ allstamped = \ ...@@ -1376,7 +1335,7 @@ allstamped = \
stamp-std stamp-bits stamp-bits-sup stamp-pstl stamp-c_base stamp-c_compatibility \ stamp-std stamp-bits stamp-bits-sup stamp-pstl stamp-c_base stamp-c_compatibility \
stamp-backward stamp-ext stamp-pb stamp-tr1 stamp-tr2 stamp-decimal \ stamp-backward stamp-ext stamp-pb stamp-tr1 stamp-tr2 stamp-decimal \
stamp-experimental stamp-experimental-bits stamp-debug stamp-parallel \ stamp-experimental stamp-experimental-bits stamp-debug stamp-parallel \
stamp-profile stamp-profile-impl stamp-host stamp-host
# List of all files that are created by explicit building, editing, or # List of all files that are created by explicit building, editing, or
...@@ -1694,16 +1653,6 @@ stamp-parallel: ${parallel_headers} ...@@ -1694,16 +1653,6 @@ stamp-parallel: ${parallel_headers}
@-cd ${parallel_builddir} && $(LN_S) $? . 2>/dev/null @-cd ${parallel_builddir} && $(LN_S) $? . 2>/dev/null
@$(STAMP) stamp-parallel @$(STAMP) stamp-parallel
stamp-profile: ${profile_headers}
@-mkdir -p ${profile_builddir}
@-cd ${profile_builddir} && $(LN_S) $? . 2>/dev/null
@$(STAMP) stamp-profile
stamp-profile-impl: ${profile_impl_headers}
@-mkdir -p ${profile_impl_builddir}
@-cd ${profile_impl_builddir} && $(LN_S) $? . 2>/dev/null
@$(STAMP) stamp-profile-impl
stamp-${host_alias}: stamp-${host_alias}:
@-mkdir -p ${host_builddir} @-mkdir -p ${host_builddir}
@-mkdir -p ${host_builddir}/../ext @-mkdir -p ${host_builddir}/../ext
...@@ -1974,12 +1923,6 @@ install-headers: ...@@ -1974,12 +1923,6 @@ install-headers:
$(mkinstalldirs) $(DESTDIR)${gxx_include_dir}/${parallel_builddir} $(mkinstalldirs) $(DESTDIR)${gxx_include_dir}/${parallel_builddir}
for file in ${parallel_headers}; do \ for file in ${parallel_headers}; do \
$(INSTALL_DATA) $${file} $(DESTDIR)${gxx_include_dir}/${parallel_builddir}; done $(INSTALL_DATA) $${file} $(DESTDIR)${gxx_include_dir}/${parallel_builddir}; done
$(mkinstalldirs) $(DESTDIR)${gxx_include_dir}/${profile_builddir}
for file in ${profile_headers}; do \
$(INSTALL_DATA) $${file} $(DESTDIR)${gxx_include_dir}/${profile_builddir}; done
$(mkinstalldirs) $(DESTDIR)${gxx_include_dir}/${profile_impl_builddir}
for file in ${profile_impl_headers}; do \
$(INSTALL_DATA) $${file} $(DESTDIR)${gxx_include_dir}/${profile_impl_builddir}; done
$(mkinstalldirs) $(DESTDIR)${host_installdir} $(mkinstalldirs) $(DESTDIR)${host_installdir}
for file in ${host_headers} ${bits_host_headers} ${host_headers_extra} \ for file in ${host_headers} ${bits_host_headers} ${host_headers_extra} \
${thread_host_headers}; do \ ${thread_host_headers}; do \
......
...@@ -207,7 +207,6 @@ ...@@ -207,7 +207,6 @@
{ {
namespace __debug { } namespace __debug { }
namespace __parallel { } namespace __parallel { }
namespace __profile { }
namespace __cxx1998 { } namespace __cxx1998 { }
namespace __detail { namespace __detail {
...@@ -325,9 +324,8 @@ _GLIBCXX_END_NAMESPACE_VERSION ...@@ -325,9 +324,8 @@ _GLIBCXX_END_NAMESPACE_VERSION
# define _GLIBCXX_END_NAMESPACE_VERSION # define _GLIBCXX_END_NAMESPACE_VERSION
#endif #endif
// Inline namespaces for special modes: debug, parallel, profile. // Inline namespaces for special modes: debug, parallel.
#if defined(_GLIBCXX_DEBUG) || defined(_GLIBCXX_PARALLEL) \ #if defined(_GLIBCXX_DEBUG) || defined(_GLIBCXX_PARALLEL)
|| defined(_GLIBCXX_PROFILE)
namespace std namespace std
{ {
_GLIBCXX_BEGIN_NAMESPACE_VERSION _GLIBCXX_BEGIN_NAMESPACE_VERSION
...@@ -351,23 +349,12 @@ _GLIBCXX_END_NAMESPACE_VERSION ...@@ -351,23 +349,12 @@ _GLIBCXX_END_NAMESPACE_VERSION
# ifdef _GLIBCXX_PARALLEL # ifdef _GLIBCXX_PARALLEL
inline namespace __parallel { } inline namespace __parallel { }
# endif # endif
// Inline namespaces for profile mode
# ifdef _GLIBCXX_PROFILE
inline namespace __profile { }
# endif
} }
// Check for invalid usage and unsupported mixed-mode use. // Check for invalid usage and unsupported mixed-mode use.
# if defined(_GLIBCXX_DEBUG) && defined(_GLIBCXX_PARALLEL) # if defined(_GLIBCXX_DEBUG) && defined(_GLIBCXX_PARALLEL)
# error illegal use of multiple inlined namespaces # error illegal use of multiple inlined namespaces
# endif # endif
# if defined(_GLIBCXX_PROFILE) && defined(_GLIBCXX_DEBUG)
# error illegal use of multiple inlined namespaces
# endif
# if defined(_GLIBCXX_PROFILE) && defined(_GLIBCXX_PARALLEL)
# error illegal use of multiple inlined namespaces
# endif
// Check for invalid use due to lack for weak symbols. // Check for invalid use due to lack for weak symbols.
# if __NO_INLINE__ && !__GXX_WEAK__ # if __NO_INLINE__ && !__GXX_WEAK__
...@@ -386,7 +373,7 @@ _GLIBCXX_END_NAMESPACE_VERSION ...@@ -386,7 +373,7 @@ _GLIBCXX_END_NAMESPACE_VERSION
// _GLIBCXX_END_NAMESPACE_ALGO // _GLIBCXX_END_NAMESPACE_ALGO
// _GLIBCXX_BEGIN_NAMESPACE_CONTAINER // _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
// _GLIBCXX_END_NAMESPACE_CONTAINER // _GLIBCXX_END_NAMESPACE_CONTAINER
#if defined(_GLIBCXX_DEBUG) || defined(_GLIBCXX_PROFILE) #if defined(_GLIBCXX_DEBUG)
# define _GLIBCXX_STD_C __cxx1998 # define _GLIBCXX_STD_C __cxx1998
# define _GLIBCXX_BEGIN_NAMESPACE_CONTAINER \ # define _GLIBCXX_BEGIN_NAMESPACE_CONTAINER \
namespace _GLIBCXX_STD_C { namespace _GLIBCXX_STD_C {
......
// Profile array implementation -*- C++ -*-
// Copyright (C) 2012-2019 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 3, or (at your option)
// any later version.
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// Under Section 7 of GPL version 3, you are granted additional
// permissions described in the GCC Runtime Library Exception, version
// 3.1, as published by the Free Software Foundation.
// You should have received a copy of the GNU General Public License and
// a copy of the GCC Runtime Library Exception along with this program;
// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
// <http://www.gnu.org/licenses/>.
/** @file profile/array
* This is a Standard C++ Library header.
*/
#ifndef _GLIBCXX_PROFILE_ARRAY
#define _GLIBCXX_PROFILE_ARRAY 1
#pragma GCC system_header
#include <array>
namespace std _GLIBCXX_VISIBILITY(default)
{
namespace __profile
{
template<typename _Tp, std::size_t _Nm>
struct array
{
typedef _Tp value_type;
typedef value_type* pointer;
typedef const value_type* const_pointer;
typedef value_type& reference;
typedef const value_type& const_reference;
typedef value_type* iterator;
typedef const value_type* const_iterator;
typedef std::size_t size_type;
typedef std::ptrdiff_t difference_type;
typedef std::reverse_iterator<iterator> reverse_iterator;
typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
// Support for zero-sized arrays mandatory.
typedef _GLIBCXX_STD_C::__array_traits<_Tp, _Nm> _AT_Type;
typename _AT_Type::_Type _M_elems;
// No explicit construct/copy/destroy for aggregate type.
// DR 776.
void
fill(const value_type& __u)
{ std::fill_n(begin(), size(), __u); }
void
swap(array& __other)
noexcept(_AT_Type::_Is_nothrow_swappable::value)
{ std::swap_ranges(begin(), end(), __other.begin()); }
// Iterators.
_GLIBCXX17_CONSTEXPR iterator
begin() noexcept
{ return iterator(data()); }
_GLIBCXX17_CONSTEXPR const_iterator
begin() const noexcept
{ return const_iterator(data()); }
_GLIBCXX17_CONSTEXPR iterator
end() noexcept
{ return iterator(data() + _Nm); }
_GLIBCXX17_CONSTEXPR const_iterator
end() const noexcept
{ return const_iterator(data() + _Nm); }
_GLIBCXX17_CONSTEXPR reverse_iterator
rbegin() noexcept
{ return reverse_iterator(end()); }
_GLIBCXX17_CONSTEXPR const_reverse_iterator
rbegin() const noexcept
{ return const_reverse_iterator(end()); }
_GLIBCXX17_CONSTEXPR reverse_iterator
rend() noexcept
{ return reverse_iterator(begin()); }
_GLIBCXX17_CONSTEXPR const_reverse_iterator
rend() const noexcept
{ return const_reverse_iterator(begin()); }
_GLIBCXX17_CONSTEXPR const_iterator
cbegin() const noexcept
{ return const_iterator(data()); }
_GLIBCXX17_CONSTEXPR const_iterator
cend() const noexcept
{ return const_iterator(data() + _Nm); }
_GLIBCXX17_CONSTEXPR const_reverse_iterator
crbegin() const noexcept
{ return const_reverse_iterator(end()); }
_GLIBCXX17_CONSTEXPR const_reverse_iterator
crend() const noexcept
{ return const_reverse_iterator(begin()); }
// Capacity.
constexpr size_type
size() const noexcept { return _Nm; }
constexpr size_type
max_size() const noexcept { return _Nm; }
_GLIBCXX_NODISCARD constexpr bool
empty() const noexcept { return size() == 0; }
// Element access.
reference
operator[](size_type __n) noexcept
{ return _AT_Type::_S_ref(_M_elems, __n); }
constexpr const_reference
operator[](size_type __n) const noexcept
{ return _AT_Type::_S_ref(_M_elems, __n); }
_GLIBCXX17_CONSTEXPR reference
at(size_type __n)
{
if (__n >= _Nm)
std::__throw_out_of_range_fmt(__N("array::at: __n "
"(which is %zu) >= _Nm "
"(which is %zu)"),
__n, _Nm);
return _AT_Type::_S_ref(_M_elems, __n);
}
constexpr const_reference
at(size_type __n) const
{
// Result of conditional expression must be an lvalue so use
// boolean ? lvalue : (throw-expr, lvalue)
return __n < _Nm ? _AT_Type::_S_ref(_M_elems, __n)
: (std::__throw_out_of_range_fmt(__N("array::at: __n (which is %zu) "
">= _Nm (which is %zu)"),
__n, _Nm),
_AT_Type::_S_ref(_M_elems, 0));
}
_GLIBCXX17_CONSTEXPR reference
front() noexcept
{ return *begin(); }
constexpr const_reference
front() const noexcept
{ return _AT_Type::_S_ref(_M_elems, 0); }
_GLIBCXX17_CONSTEXPR reference
back() noexcept
{ return _Nm ? *(end() - 1) : *end(); }
constexpr const_reference
back() const noexcept
{
return _Nm ? _AT_Type::_S_ref(_M_elems, _Nm - 1)
: _AT_Type::_S_ref(_M_elems, 0);
}
_GLIBCXX17_CONSTEXPR pointer
data() noexcept
{ return _AT_Type::_S_ptr(_M_elems); }
_GLIBCXX17_CONSTEXPR const_pointer
data() const noexcept
{ return _AT_Type::_S_ptr(_M_elems); }
};
// Array comparisons.
template<typename _Tp, std::size_t _Nm>
inline bool
operator==(const array<_Tp, _Nm>& __one, const array<_Tp, _Nm>& __two)
{ return std::equal(__one.begin(), __one.end(), __two.begin()); }
template<typename _Tp, std::size_t _Nm>
inline bool
operator!=(const array<_Tp, _Nm>& __one, const array<_Tp, _Nm>& __two)
{ return !(__one == __two); }
template<typename _Tp, std::size_t _Nm>
inline bool
operator<(const array<_Tp, _Nm>& __a, const array<_Tp, _Nm>& __b)
{
return std::lexicographical_compare(__a.begin(), __a.end(),
__b.begin(), __b.end());
}
template<typename _Tp, std::size_t _Nm>
inline bool
operator>(const array<_Tp, _Nm>& __one, const array<_Tp, _Nm>& __two)
{ return __two < __one; }
template<typename _Tp, std::size_t _Nm>
inline bool
operator<=(const array<_Tp, _Nm>& __one, const array<_Tp, _Nm>& __two)
{ return !(__one > __two); }
template<typename _Tp, std::size_t _Nm>
inline bool
operator>=(const array<_Tp, _Nm>& __one, const array<_Tp, _Nm>& __two)
{ return !(__one < __two); }
// Specialized algorithms.
template<typename _Tp, std::size_t _Nm>
inline void
swap(array<_Tp, _Nm>& __one, array<_Tp, _Nm>& __two)
noexcept(noexcept(__one.swap(__two)))
{ __one.swap(__two); }
template<std::size_t _Int, typename _Tp, std::size_t _Nm>
constexpr _Tp&
get(array<_Tp, _Nm>& __arr) noexcept
{
static_assert(_Int < _Nm, "index is out of bounds");
return _GLIBCXX_STD_C::__array_traits<_Tp, _Nm>::
_S_ref(__arr._M_elems, _Int);
}
template<std::size_t _Int, typename _Tp, std::size_t _Nm>
constexpr _Tp&&
get(array<_Tp, _Nm>&& __arr) noexcept
{
static_assert(_Int < _Nm, "index is out of bounds");
return std::move(__profile::get<_Int>(__arr));
}
template<std::size_t _Int, typename _Tp, std::size_t _Nm>
constexpr const _Tp&
get(const array<_Tp, _Nm>& __arr) noexcept
{
static_assert(_Int < _Nm, "index is out of bounds");
return _GLIBCXX_STD_C::__array_traits<_Tp, _Nm>::
_S_ref(__arr._M_elems, _Int);
}
} // namespace __profile
_GLIBCXX_BEGIN_NAMESPACE_VERSION
// Tuple interface to class template array.
/// tuple_size
template<typename _Tp, std::size_t _Nm>
struct tuple_size<std::__profile::array<_Tp, _Nm>>
: public integral_constant<std::size_t, _Nm> { };
/// tuple_element
template<std::size_t _Int, typename _Tp, std::size_t _Nm>
struct tuple_element<_Int, std::__profile::array<_Tp, _Nm>>
{
static_assert(_Int < _Nm, "index is out of bounds");
typedef _Tp type;
};
template<typename _Tp, std::size_t _Nm>
struct __is_tuple_like_impl<std::__profile::array<_Tp, _Nm>> : true_type
{ };
_GLIBCXX_END_NAMESPACE_VERSION
} // namespace std
#endif // _GLIBCXX_PROFILE_ARRAY
// -*- C++ -*-
// Copyright (C) 2009-2019 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 3, or (at your option)
// any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// Under Section 7 of GPL version 3, you are granted additional
// permissions described in the GCC Runtime Library Exception, version
// 3.1, as published by the Free Software Foundation.
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
/** @file profile/base.h
* @brief Sequential helper functions.
* This file is a GNU profile extension to the Standard C++ Library.
*/
// Written by Lixia Liu
#ifndef _GLIBCXX_PROFILE_BASE_H
#define _GLIBCXX_PROFILE_BASE_H 1
#include <profile/impl/profiler.h>
// Profiling mode namespaces.
/**
* @namespace std::__profile
* @brief GNU profile code, replaces standard behavior with profile behavior.
*/
namespace std _GLIBCXX_VISIBILITY(default)
{
namespace __profile { }
}
/**
* @namespace __gnu_profile
* @brief GNU profile code for public use.
*/
namespace __gnu_profile
{
// Import all the profile versions of components in namespace std.
using namespace std::__profile;
}
#endif /* _GLIBCXX_PROFILE_BASE_H */
// Profiling bitset implementation -*- C++ -*-
// Copyright (C) 2009-2019 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 3, or (at your option)
// any later version.
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// Under Section 7 of GPL version 3, you are granted additional
// permissions described in the GCC Runtime Library Exception, version
// 3.1, as published by the Free Software Foundation.
// You should have received a copy of the GNU General Public License and
// a copy of the GCC Runtime Library Exception along with this program;
// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
// <http://www.gnu.org/licenses/>.
/** @file profile/bitset
* This file is a GNU profile extension to the Standard C++ Library.
*/
#ifndef _GLIBCXX_PROFILE_BITSET
#define _GLIBCXX_PROFILE_BITSET
#include <bitset>
namespace std _GLIBCXX_VISIBILITY(default)
{
namespace __profile
{
/// Class std::bitset wrapper with performance instrumentation, none at the
/// moment.
template<size_t _Nb>
class bitset
: public _GLIBCXX_STD_C::bitset<_Nb>
{
typedef _GLIBCXX_STD_C::bitset<_Nb> _Base;
public:
// 23.3.5.1 constructors:
#if __cplusplus < 201103L
bitset()
: _Base() { }
#else
constexpr bitset() = default;
#endif
#if __cplusplus >= 201103L
constexpr bitset(unsigned long long __val) noexcept
#else
bitset(unsigned long __val)
#endif
: _Base(__val) { }
template<typename _CharT, typename _Traits, typename _Alloc>
explicit
bitset(const std::basic_string<_CharT, _Traits, _Alloc>& __str,
typename std::basic_string<_CharT, _Traits, _Alloc>::size_type
__pos = 0,
typename std::basic_string<_CharT, _Traits, _Alloc>::size_type
__n = (std::basic_string<_CharT, _Traits, _Alloc>::npos))
: _Base(__str, __pos, __n) { }
// _GLIBCXX_RESOLVE_LIB_DEFECTS
// 396. what are characters zero and one.
template<class _CharT, class _Traits, class _Alloc>
bitset(const std::basic_string<_CharT, _Traits, _Alloc>& __str,
typename std::basic_string<_CharT, _Traits, _Alloc>::size_type
__pos,
typename std::basic_string<_CharT, _Traits, _Alloc>::size_type
__n,
_CharT __zero, _CharT __one = _CharT('1'))
: _Base(__str, __pos, __n, __zero, __one) { }
bitset(const _Base& __x) : _Base(__x) { }
#if __cplusplus >= 201103L
template<typename _CharT>
explicit
bitset(const _CharT* __str,
typename std::basic_string<_CharT>::size_type __n
= std::basic_string<_CharT>::npos,
_CharT __zero = _CharT('0'), _CharT __one = _CharT('1'))
: _Base(__str, __n, __zero, __one) { }
#endif
// 23.3.5.2 bitset operations:
bitset<_Nb>&
operator&=(const bitset<_Nb>& __rhs) _GLIBCXX_NOEXCEPT
{
_M_base() &= __rhs;
return *this;
}
bitset<_Nb>&
operator|=(const bitset<_Nb>& __rhs) _GLIBCXX_NOEXCEPT
{
_M_base() |= __rhs;
return *this;
}
bitset<_Nb>&
operator^=(const bitset<_Nb>& __rhs) _GLIBCXX_NOEXCEPT
{
_M_base() ^= __rhs;
return *this;
}
bitset<_Nb>&
operator<<=(size_t __pos) _GLIBCXX_NOEXCEPT
{
_M_base() <<= __pos;
return *this;
}
bitset<_Nb>&
operator>>=(size_t __pos) _GLIBCXX_NOEXCEPT
{
_M_base() >>= __pos;
return *this;
}
bitset<_Nb>&
set() _GLIBCXX_NOEXCEPT
{
_Base::set();
return *this;
}
// _GLIBCXX_RESOLVE_LIB_DEFECTS
// 186. bitset::set() second parameter should be bool
bitset<_Nb>&
set(size_t __pos, bool __val = true)
{
_Base::set(__pos, __val);
return *this;
}
bitset<_Nb>&
reset() _GLIBCXX_NOEXCEPT
{
_Base::reset();
return *this;
}
bitset<_Nb>&
reset(size_t __pos)
{
_Base::reset(__pos);
return *this;
}
bitset<_Nb>
operator~() const _GLIBCXX_NOEXCEPT
{ return bitset(~_M_base()); }
bitset<_Nb>&
flip() _GLIBCXX_NOEXCEPT
{
_Base::flip();
return *this;
}
bitset<_Nb>&
flip(size_t __pos)
{
_Base::flip(__pos);
return *this;
}
bool
operator==(const bitset<_Nb>& __rhs) const _GLIBCXX_NOEXCEPT
{ return _M_base() == __rhs; }
bool
operator!=(const bitset<_Nb>& __rhs) const _GLIBCXX_NOEXCEPT
{ return _M_base() != __rhs; }
bitset<_Nb>
operator<<(size_t __pos) const _GLIBCXX_NOEXCEPT
{ return bitset<_Nb>(_M_base() << __pos); }
bitset<_Nb>
operator>>(size_t __pos) const _GLIBCXX_NOEXCEPT
{ return bitset<_Nb>(_M_base() >> __pos); }
_Base&
_M_base() _GLIBCXX_NOEXCEPT
{ return *this; }
const _Base&
_M_base() const _GLIBCXX_NOEXCEPT
{ return *this; }
};
template<size_t _Nb>
bitset<_Nb>
operator&(const bitset<_Nb>& __x, const bitset<_Nb>& __y) _GLIBCXX_NOEXCEPT
{ return bitset<_Nb>(__x) &= __y; }
template<size_t _Nb>
bitset<_Nb>
operator|(const bitset<_Nb>& __x, const bitset<_Nb>& __y) _GLIBCXX_NOEXCEPT
{ return bitset<_Nb>(__x) |= __y; }
template<size_t _Nb>
bitset<_Nb>
operator^(const bitset<_Nb>& __x, const bitset<_Nb>& __y) _GLIBCXX_NOEXCEPT
{ return bitset<_Nb>(__x) ^= __y; }
template<typename _CharT, typename _Traits, size_t _Nb>
std::basic_istream<_CharT, _Traits>&
operator>>(std::basic_istream<_CharT, _Traits>& __is, bitset<_Nb>& __x)
{ return __is >> __x._M_base(); }
template<typename _CharT, typename _Traits, size_t _Nb>
std::basic_ostream<_CharT, _Traits>&
operator<<(std::basic_ostream<_CharT, _Traits>& __os,
const bitset<_Nb>& __x)
{ return __os << __x._M_base(); }
} // namespace __profile
#if __cplusplus >= 201103L
// DR 1182.
/// std::hash specialization for bitset.
template<size_t _Nb>
struct hash<__profile::bitset<_Nb>>
: public __hash_base<size_t, __profile::bitset<_Nb>>
{
size_t
operator()(const __profile::bitset<_Nb>& __b) const noexcept
{ return std::hash<_GLIBCXX_STD_C::bitset<_Nb>>()(__b._M_base()); }
};
#endif
} // namespace std
#endif
// Profiling deque implementation -*- C++ -*-
// Copyright (C) 2009-2019 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 3, or (at your option)
// any later version.
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// Under Section 7 of GPL version 3, you are granted additional
// permissions described in the GCC Runtime Library Exception, version
// 3.1, as published by the Free Software Foundation.
// You should have received a copy of the GNU General Public License and
// a copy of the GCC Runtime Library Exception along with this program;
// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
// <http://www.gnu.org/licenses/>.
/** @file profile/deque
* This file is a GNU profile extension to the Standard C++ Library.
*/
#ifndef _GLIBCXX_PROFILE_DEQUE
#define _GLIBCXX_PROFILE_DEQUE 1
#include <deque>
namespace std _GLIBCXX_VISIBILITY(default)
{
namespace __profile
{
/// Class std::deque wrapper with performance instrumentation.
template<typename _Tp, typename _Allocator = std::allocator<_Tp> >
class deque
: public _GLIBCXX_STD_C::deque<_Tp, _Allocator>
{
typedef _GLIBCXX_STD_C::deque<_Tp, _Allocator> _Base;
public:
typedef typename _Base::size_type size_type;
typedef typename _Base::value_type value_type;
// 23.2.1.1 construct/copy/destroy:
#if __cplusplus < 201103L
deque()
: _Base() { }
deque(const deque& __x)
: _Base(__x) { }
~deque() { }
#else
deque() = default;
deque(const deque&) = default;
deque(deque&&) = default;
deque(const deque& __d, const _Allocator& __a)
: _Base(__d, __a) { }
deque(deque&& __d, const _Allocator& __a)
: _Base(std::move(__d), __a) { }
~deque() = default;
deque(initializer_list<value_type> __l,
const _Allocator& __a = _Allocator())
: _Base(__l, __a) { }
#endif
explicit
deque(const _Allocator& __a)
: _Base(__a) { }
#if __cplusplus >= 201103L
explicit
deque(size_type __n, const _Allocator& __a = _Allocator())
: _Base(__n, __a) { }
deque(size_type __n, const _Tp& __value,
const _Allocator& __a = _Allocator())
: _Base(__n, __value, __a) { }
#else
explicit
deque(size_type __n, const _Tp& __value = _Tp(),
const _Allocator& __a = _Allocator())
: _Base(__n, __value, __a) { }
#endif
#if __cplusplus >= 201103L
template<typename _InputIterator,
typename = std::_RequireInputIter<_InputIterator>>
#else
template<typename _InputIterator>
#endif
deque(_InputIterator __first, _InputIterator __last,
const _Allocator& __a = _Allocator())
: _Base(__first, __last, __a)
{ }
deque(const _Base& __x)
: _Base(__x) { }
#if __cplusplus < 201103L
deque&
operator=(const deque& __x)
{
_M_base() = __x;
return *this;
}
#else
deque&
operator=(const deque&) = default;
deque&
operator=(deque&&) = default;
deque&
operator=(initializer_list<value_type> __l)
{
_M_base() = __l;
return *this;
}
#endif
void
swap(deque& __x)
_GLIBCXX_NOEXCEPT_IF( noexcept(declval<_Base&>().swap(__x)) )
{ _Base::swap(__x); }
_Base&
_M_base() _GLIBCXX_NOEXCEPT { return *this; }
const _Base&
_M_base() const _GLIBCXX_NOEXCEPT { return *this; }
};
template<typename _Tp, typename _Alloc>
inline bool
operator==(const deque<_Tp, _Alloc>& __lhs,
const deque<_Tp, _Alloc>& __rhs)
{ return __lhs._M_base() == __rhs._M_base(); }
template<typename _Tp, typename _Alloc>
inline bool
operator!=(const deque<_Tp, _Alloc>& __lhs,
const deque<_Tp, _Alloc>& __rhs)
{ return __lhs._M_base() != __rhs._M_base(); }
template<typename _Tp, typename _Alloc>
inline bool
operator<(const deque<_Tp, _Alloc>& __lhs,
const deque<_Tp, _Alloc>& __rhs)
{ return __lhs._M_base() < __rhs._M_base(); }
template<typename _Tp, typename _Alloc>
inline bool
operator<=(const deque<_Tp, _Alloc>& __lhs,
const deque<_Tp, _Alloc>& __rhs)
{ return __lhs._M_base() <= __rhs._M_base(); }
template<typename _Tp, typename _Alloc>
inline bool
operator>=(const deque<_Tp, _Alloc>& __lhs,
const deque<_Tp, _Alloc>& __rhs)
{ return __lhs._M_base() >= __rhs._M_base(); }
template<typename _Tp, typename _Alloc>
inline bool
operator>(const deque<_Tp, _Alloc>& __lhs,
const deque<_Tp, _Alloc>& __rhs)
{ return __lhs._M_base() > __rhs._M_base(); }
template<typename _Tp, typename _Alloc>
inline void
swap(deque<_Tp, _Alloc>& __lhs, deque<_Tp, _Alloc>& __rhs)
_GLIBCXX_NOEXCEPT_IF(noexcept(__lhs.swap(__rhs)))
{ __lhs.swap(__rhs); }
} // namespace __profile
} // namespace std
#endif
// <forward_list> -*- C++ -*-
// Copyright (C) 2010-2019 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 3, or (at your option)
// any later version.
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// Under Section 7 of GPL version 3, you are granted additional
// permissions described in the GCC Runtime Library Exception, version
// 3.1, as published by the Free Software Foundation.
// You should have received a copy of the GNU General Public License and
// a copy of the GCC Runtime Library Exception along with this program;
// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
// <http://www.gnu.org/licenses/>.
/** @file profile/forward_list
* This file is a GNU debug extension to the Standard C++ Library.
*/
#ifndef _GLIBCXX_PROFILE_FORWARD_LIST
#define _GLIBCXX_PROFILE_FORWARD_LIST 1
#if __cplusplus < 201103L
# include <bits/c++0x_warning.h>
#else
#include <forward_list>
namespace std _GLIBCXX_VISIBILITY(default)
{
namespace __profile
{
/// Class std::forward_list wrapper with performance instrumentation.
template<typename _Tp, typename _Alloc = std::allocator<_Tp> >
class forward_list
: public _GLIBCXX_STD_C::forward_list<_Tp, _Alloc>
{
typedef _GLIBCXX_STD_C::forward_list<_Tp, _Alloc> _Base;
public:
typedef typename _Base::size_type size_type;
typedef typename _Base::const_iterator const_iterator;
// 23.2.3.1 construct/copy/destroy:
forward_list() = default;
explicit
forward_list(const _Alloc& __al) noexcept
: _Base(__al) { }
forward_list(const forward_list& __list, const _Alloc& __al)
: _Base(__list, __al)
{ }
forward_list(forward_list&& __list, const _Alloc& __al)
: _Base(std::move(__list), __al)
{ }
explicit
forward_list(size_type __n, const _Alloc& __al = _Alloc())
: _Base(__n, __al)
{ }
forward_list(size_type __n, const _Tp& __value,
const _Alloc& __al = _Alloc())
: _Base(__n, __value, __al)
{ }
template<typename _InputIterator,
typename = std::_RequireInputIter<_InputIterator>>
forward_list(_InputIterator __first, _InputIterator __last,
const _Alloc& __al = _Alloc())
: _Base(__first, __last, __al)
{ }
forward_list(const forward_list&) = default;
forward_list(forward_list&&) = default;
forward_list(std::initializer_list<_Tp> __il,
const _Alloc& __al = _Alloc())
: _Base(__il, __al)
{ }
~forward_list() = default;
forward_list&
operator=(const forward_list&) = default;
forward_list&
operator=(forward_list&&) = default;
forward_list&
operator=(std::initializer_list<_Tp> __il)
{
_M_base() = __il;
return *this;
}
void
swap(forward_list& __fl)
noexcept( noexcept(declval<_Base&>().swap(__fl)) )
{ _Base::swap(__fl); }
void
splice_after(const_iterator __pos, forward_list&& __fl)
{ _Base::splice_after(__pos, std::move(__fl)); }
void
splice_after(const_iterator __pos, forward_list& __list)
{ _Base::splice_after(__pos, __list); }
void
splice_after(const_iterator __pos, forward_list&& __list,
const_iterator __i)
{ _Base::splice_after(__pos, std::move(__list), __i); }
void
splice_after(const_iterator __pos, forward_list& __list,
const_iterator __i)
{ _Base::splice_after(__pos, __list, __i); }
void
splice_after(const_iterator __pos, forward_list&& __list,
const_iterator __before, const_iterator __last)
{ _Base::splice_after(__pos, std::move(__list), __before, __last); }
void
splice_after(const_iterator __pos, forward_list& __list,
const_iterator __before, const_iterator __last)
{ _Base::splice_after(__pos, __list, __before, __last); }
void
merge(forward_list&& __list)
{ _Base::merge(std::move(__list)); }
void
merge(forward_list& __list)
{ _Base::merge(__list); }
template<typename _Comp>
void
merge(forward_list&& __list, _Comp __comp)
{ _Base::merge(std::move(__list), __comp); }
template<typename _Comp>
void
merge(forward_list& __list, _Comp __comp)
{ _Base::merge(__list, __comp); }
_Base&
_M_base() noexcept { return *this; }
const _Base&
_M_base() const noexcept { return *this; }
};
template<typename _Tp, typename _Alloc>
inline bool
operator==(const forward_list<_Tp, _Alloc>& __lx,
const forward_list<_Tp, _Alloc>& __ly)
{ return __lx._M_base() == __ly._M_base(); }
template<typename _Tp, typename _Alloc>
inline bool
operator<(const forward_list<_Tp, _Alloc>& __lx,
const forward_list<_Tp, _Alloc>& __ly)
{ return __lx._M_base() < __ly._M_base(); }
template<typename _Tp, typename _Alloc>
inline bool
operator!=(const forward_list<_Tp, _Alloc>& __lx,
const forward_list<_Tp, _Alloc>& __ly)
{ return !(__lx == __ly); }
/// Based on operator<
template<typename _Tp, typename _Alloc>
inline bool
operator>(const forward_list<_Tp, _Alloc>& __lx,
const forward_list<_Tp, _Alloc>& __ly)
{ return (__ly < __lx); }
/// Based on operator<
template<typename _Tp, typename _Alloc>
inline bool
operator>=(const forward_list<_Tp, _Alloc>& __lx,
const forward_list<_Tp, _Alloc>& __ly)
{ return !(__lx < __ly); }
/// Based on operator<
template<typename _Tp, typename _Alloc>
inline bool
operator<=(const forward_list<_Tp, _Alloc>& __lx,
const forward_list<_Tp, _Alloc>& __ly)
{ return !(__ly < __lx); }
/// See std::forward_list::swap().
template<typename _Tp, typename _Alloc>
inline void
swap(forward_list<_Tp, _Alloc>& __lx,
forward_list<_Tp, _Alloc>& __ly)
noexcept(noexcept(__lx.swap(__ly)))
{ __lx.swap(__ly); }
} // namespace __profile
} // namespace std
#endif // C++11
#endif
// -*- C++ -*-
//
// Copyright (C) 2010-2019 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 3, or (at your option)
// any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// Under Section 7 of GPL version 3, you are granted additional
// permissions described in the GCC Runtime Library Exception, version
// 3.1, as published by the Free Software Foundation.
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
/** @file profile/impl/profiler_algos.h
* @brief Algorithms used by the profile extension.
*
* This file is needed to avoid including \<algorithm\> or \<bits/stl_algo.h\>.
* Including those files would result in recursive includes.
* These implementations are oversimplified. In general, efficiency may be
* sacrificed to minimize maintenance overhead.
*/
#ifndef _GLIBCXX_PROFILE_PROFILER_ALGOS_H
#define _GLIBCXX_PROFILE_PROFILER_ALGOS_H 1
namespace __gnu_profile
{
/* Helper for __top_n. Insert in sorted vector, but not beyond Nth elem. */
template<typename _Container>
void
__insert_top_n(_Container& __output,
const typename _Container::value_type& __value,
typename _Container::size_type __n)
{
typename _Container::iterator __it = __output.begin();
typename _Container::size_type __count = 0;
// Skip up to N - 1 elements larger than VALUE.
// XXX: Could do binary search for random iterators.
while (true)
{
if (__count >= __n)
// VALUE is not in top N.
return;
if (__it == __output.end())
break;
if (*__it < __value)
break;
++__it;
++__count;
}
__output.insert(__it, __value);
}
/* Copy the top N elements in INPUT, sorted in reverse order, to OUTPUT. */
template<typename _Container>
void
__top_n(const _Container& __input, _Container& __output,
typename _Container::size_type __n)
{
__output.clear();
typename _Container::const_iterator __it;
for (__it = __input.begin(); __it != __input.end(); ++__it)
__insert_top_n(__output, *__it, __n);
}
/* Simplified clone of std::for_each. */
template<typename _InputIterator, typename _Function>
_Function
__for_each(_InputIterator __first, _InputIterator __last, _Function __f)
{
for (; __first != __last; ++__first)
__f(*__first);
return __f;
}
/* Simplified clone of std::remove. */
template<typename _ForwardIterator, typename _Tp>
_ForwardIterator
__remove(_ForwardIterator __first, _ForwardIterator __last,
const _Tp& __value)
{
if(__first == __last)
return __first;
_ForwardIterator __result = __first;
++__first;
for(; __first != __last; ++__first)
if(!(*__first == __value))
{
*__result = *__first;
++__result;
}
return __result;
}
} // namespace __gnu_profile
#endif /* _GLIBCXX_PROFILE_PROFILER_ALGOS_H */
// -*- C++ -*-
//
// Copyright (C) 2009-2019 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 3, or (at your option)
// any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// Under Section 7 of GPL version 3, you are granted additional
// permissions described in the GCC Runtime Library Exception, version
// 3.1, as published by the Free Software Foundation.
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
/** @file profile/impl/profiler_container_size.h
* @brief Diagnostics for container sizes.
*/
// Written by Lixia Liu and Silvius Rus.
#ifndef _GLIBCXX_PROFILE_PROFILER_CONTAINER_SIZE_H
#define _GLIBCXX_PROFILE_PROFILER_CONTAINER_SIZE_H 1
#include <sstream>
#include "profile/impl/profiler.h"
#include "profile/impl/profiler_node.h"
#include "profile/impl/profiler_trace.h"
namespace __gnu_profile
{
/** @brief A container size instrumentation line in the object table. */
class __container_size_info
: public __object_info_base
{
public:
__container_size_info(__stack_t __stack)
: __object_info_base(__stack), _M_init(0), _M_max(0),
_M_min(0), _M_total(0), _M_item_min(0), _M_item_max(0),
_M_item_total(0), _M_count(0), _M_resize(0), _M_cost(0)
{ }
void
__write(FILE* __f) const
{
std::fprintf(__f, "%Zu %Zu %Zu %Zu %Zu %Zu %Zu %Zu %Zu %Zu\n",
_M_init, _M_count, _M_cost, _M_resize, _M_min, _M_max,
_M_total, _M_item_min, _M_item_max, _M_item_total);
}
float
__magnitude() const
{ return static_cast<float>(_M_cost); }
std::string
__advice() const
{
std::stringstream __message;
if (_M_init < _M_item_max)
__message << "change initial container size from " << _M_init
<< " to " << _M_item_max;
return __message.str();
}
void
__init(std::size_t __num)
{
_M_init = __num;
_M_max = __num;
}
void
__merge(const __container_size_info& __o)
{
__object_info_base::__merge(__o);
_M_init = std::max(_M_init, __o._M_init);
_M_max = std::max(_M_max, __o._M_max);
_M_item_max = std::max(_M_item_max, __o._M_item_max);
_M_min = std::min(_M_min, __o._M_min);
_M_item_min = std::min(_M_item_min, __o._M_item_min);
_M_total += __o._M_total;
_M_item_total += __o._M_item_total;
_M_count += __o._M_count;
_M_cost += __o._M_cost;
_M_resize += __o._M_resize;
}
// Call if a container is destructed or cleaned.
void
__destruct(std::size_t __num, std::size_t __inum)
{
_M_max = std::max(_M_max, __num);
_M_item_max = std::max(_M_item_max, __inum);
if (_M_min == 0)
{
_M_min = __num;
_M_item_min = __inum;
}
else
{
_M_min = std::min(_M_min, __num);
_M_item_min = std::min(_M_item_min, __inum);
}
_M_total += __num;
_M_item_total += __inum;
_M_count += 1;
}
// Estimate the cost of resize/rehash.
float
__resize_cost(std::size_t __from, std::size_t)
{ return __from; }
// Call if container is resized.
void
__resize(std::size_t __from, std::size_t __to)
{
_M_cost += this->__resize_cost(__from, __to);
_M_resize += 1;
_M_max = std::max(_M_max, __to);
}
private:
std::size_t _M_init;
std::size_t _M_max; // range of # buckets
std::size_t _M_min;
std::size_t _M_total;
std::size_t _M_item_min; // range of # items
std::size_t _M_item_max;
std::size_t _M_item_total;
std::size_t _M_count;
std::size_t _M_resize;
std::size_t _M_cost;
};
/** @brief A container size instrumentation line in the stack table. */
class __container_size_stack_info
: public __container_size_info
{
public:
__container_size_stack_info(const __container_size_info& __o)
: __container_size_info(__o) { }
};
/** @brief Container size instrumentation trace producer. */
class __trace_container_size
: public __trace_base<__container_size_info, __container_size_stack_info>
{
public:
~__trace_container_size() { }
__trace_container_size()
: __trace_base<__container_size_info, __container_size_stack_info>() { };
// Insert a new node at construct with object, callstack and initial size.
__container_size_info*
__insert(__stack_t __stack, std::size_t __num)
{
__container_size_info* __ret = __add_object(__stack);
if (__ret)
__ret->__init(__num);
return __ret;
}
// Call at destruction/clean to set container final size.
void
__destruct(__container_size_info* __obj_info,
std::size_t __num, std::size_t __inum)
{
__obj_info->__destruct(__num, __inum);
__retire_object(__obj_info);
}
};
} // namespace __gnu_profile
#endif /* _GLIBCXX_PROFILE_PROFILER_CONTAINER_SIZE_H */
// -*- C++ -*-
//
// Copyright (C) 2009-2019 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 3, or (at your option)
// any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// Under Section 7 of GPL version 3, you are granted additional
// permissions described in the GCC Runtime Library Exception, version
// 3.1, as published by the Free Software Foundation.
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
/** @file profile/impl/profiler_hash_func.h
* @brief Data structures to represent profiling traces.
*/
// Written by Lixia Liu and Silvius Rus.
#ifndef _GLIBCXX_PROFILE_PROFILER_HASH_FUNC_H
#define _GLIBCXX_PROFILE_PROFILER_HASH_FUNC_H 1
#include "profile/impl/profiler.h"
#include "profile/impl/profiler_node.h"
#include "profile/impl/profiler_trace.h"
namespace __gnu_profile
{
/** @brief A hash performance instrumentation line in the object table. */
class __hashfunc_info
: public __object_info_base
{
public:
__hashfunc_info(__stack_t __stack)
: __object_info_base(__stack), _M_longest_chain(0),
_M_accesses(0), _M_hops(0) { }
void
__merge(const __hashfunc_info& __o)
{
__object_info_base::__merge(__o);
_M_longest_chain = std::max(_M_longest_chain, __o._M_longest_chain);
_M_accesses += __o._M_accesses;
_M_hops += __o._M_hops;
}
void
__destruct(std::size_t __chain, std::size_t __accesses,
std::size_t __hops)
{
_M_longest_chain = std::max(_M_longest_chain, __chain);
_M_accesses += __accesses;
_M_hops += __hops;
}
void
__write(FILE* __f) const
{ std::fprintf(__f, "%Zu %Zu %Zu\n", _M_hops,
_M_accesses, _M_longest_chain); }
float
__magnitude() const
{ return static_cast<float>(_M_hops); }
std::string
__advice() const
{ return "change hash function"; }
private:
std::size_t _M_longest_chain;
std::size_t _M_accesses;
std::size_t _M_hops;
};
/** @brief A hash performance instrumentation line in the stack table. */
class __hashfunc_stack_info
: public __hashfunc_info
{
public:
__hashfunc_stack_info(const __hashfunc_info& __o)
: __hashfunc_info(__o) { }
};
/** @brief Hash performance instrumentation producer. */
class __trace_hash_func
: public __trace_base<__hashfunc_info, __hashfunc_stack_info>
{
public:
__trace_hash_func()
: __trace_base<__hashfunc_info, __hashfunc_stack_info>()
{ __id = "hash-distr"; }
~__trace_hash_func() {}
// Call at destruction/clean to set container final size.
void
__destruct(__hashfunc_info* __obj_info,
std::size_t __chain, std::size_t __accesses, std::size_t __hops)
{
if (!__obj_info)
return;
__obj_info->__destruct(__chain, __accesses, __hops);
__retire_object(__obj_info);
}
};
inline void
__trace_hash_func_init()
{ _GLIBCXX_PROFILE_DATA(_S_hash_func) = new __trace_hash_func(); }
inline void
__trace_hash_func_free()
{ delete _GLIBCXX_PROFILE_DATA(_S_hash_func); }
inline void
__trace_hash_func_report(FILE* __f, __warning_vector_t& __warnings)
{ __trace_report(_GLIBCXX_PROFILE_DATA(_S_hash_func), __f, __warnings); }
inline __hashfunc_info*
__trace_hash_func_construct()
{
if (!__profcxx_init())
return 0;
if (!__reentrance_guard::__get_in())
return 0;
__reentrance_guard __get_out;
return _GLIBCXX_PROFILE_DATA(_S_hash_func)->__add_object(__get_stack());
}
inline void
__trace_hash_func_destruct(__hashfunc_info* __obj_info,
std::size_t __chain, std::size_t __accesses,
std::size_t __hops)
{
_GLIBCXX_PROFILE_DATA(_S_hash_func)->__destruct(__obj_info, __chain,
__accesses, __hops);
}
} // namespace __gnu_profile
#endif /* _GLIBCXX_PROFILE_PROFILER_HASH_FUNC_H */
// -*- C++ -*-
//
// Copyright (C) 2009-2019 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 3, or (at your option)
// any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// Under Section 7 of GPL version 3, you are granted additional
// permissions described in the GCC Runtime Library Exception, version
// 3.1, as published by the Free Software Foundation.
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
/** @file profile/impl/profiler_hashtable_size.h
* @brief Collection of hashtable size traces.
*/
// Written by Lixia Liu and Silvius Rus.
#ifndef _GLIBCXX_PROFILE_PROFILER_HASHTABLE_SIZE_H
#define _GLIBCXX_PROFILE_PROFILER_HASHTABLE_SIZE_H 1
#include "profile/impl/profiler.h"
#include "profile/impl/profiler_node.h"
#include "profile/impl/profiler_trace.h"
#include "profile/impl/profiler_state.h"
#include "profile/impl/profiler_container_size.h"
namespace __gnu_profile
{
/** @brief Hashtable size instrumentation trace producer. */
class __trace_hashtable_size
: public __trace_container_size
{
public:
__trace_hashtable_size()
: __trace_container_size()
{ __id = "hashtable-size"; }
};
inline void
__trace_hashtable_size_init()
{ _GLIBCXX_PROFILE_DATA(_S_hashtable_size) = new __trace_hashtable_size(); }
inline void
__trace_hashtable_size_free()
{ delete _GLIBCXX_PROFILE_DATA(_S_hashtable_size); }
inline void
__trace_hashtable_size_report(FILE* __f, __warning_vector_t& __warnings)
{ __trace_report(_GLIBCXX_PROFILE_DATA(_S_hashtable_size), __f, __warnings); }
inline __container_size_info*
__trace_hashtable_size_construct(std::size_t __num)
{
if (!__profcxx_init())
return 0;
if (!__reentrance_guard::__get_in())
return 0;
__reentrance_guard __get_out;
return _GLIBCXX_PROFILE_DATA(_S_hashtable_size)->
__insert(__get_stack(), __num);
}
inline void
__trace_hashtable_size_resize(__container_size_info* __obj_info,
std::size_t __from, std::size_t __to)
{
if (!__obj_info)
return;
__obj_info->__resize(__from, __to);
}
inline void
__trace_hashtable_size_destruct(__container_size_info* __obj_info,
std::size_t __num, std::size_t __inum)
{
if (!__obj_info)
return;
_GLIBCXX_PROFILE_DATA(_S_hashtable_size)->
__destruct(__obj_info, __num, __inum);
}
} // namespace __gnu_profile
#endif /* _GLIBCXX_PROFILE_PROFILER_HASHTABLE_SIZE_H */
// -*- C++ -*-
//
// Copyright (C) 2009-2019 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 3, or (at your option)
// any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// Under Section 7 of GPL version 3, you are granted additional
// permissions described in the GCC Runtime Library Exception, version
// 3.1, as published by the Free Software Foundation.
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
/** @file profile/impl/profiler_list_to_slist.h
* @brief Diagnostics for list to slist.
*/
// Written by Changhee Jung.
#ifndef _GLIBCXX_PROFILE_PROFILER_LIST_TO_SLIST_H
#define _GLIBCXX_PROFILE_PROFILER_LIST_TO_SLIST_H 1
#include "profile/impl/profiler.h"
#include "profile/impl/profiler_node.h"
#include "profile/impl/profiler_trace.h"
namespace __gnu_profile
{
class __list2slist_info
: public __object_info_base
{
public:
__list2slist_info(__stack_t __stack)
: __object_info_base(__stack), _M_rewind(false), _M_operations(0) { }
// XXX: the magnitude should be multiplied with a constant factor F,
// where F is 1 when the malloc size class of list nodes is different
// from the malloc size class of slist nodes. When they fall into the same
// class, the only slist benefit is from having to set fewer links, so
// the factor F should be much smaller, closer to 0 than to 1.
// This could be implemented by passing the size classes in the config
// file. For now, we always assume F to be 1.
float
__magnitude() const
{
if (!_M_rewind)
return _M_operations;
else
return 0;
}
void
__write(FILE* __f) const
{ std::fprintf(__f, "%s\n", _M_rewind ? "invalid" : "valid"); }
std::string
__advice() const
{ return "change std::list to std::forward_list"; }
void
__opr_rewind()
{
_M_rewind = true;
__set_invalid();
}
void
__record_operation()
{ ++_M_operations; }
bool
__has_rewind()
{ return _M_rewind; }
private:
bool _M_rewind;
std::size_t _M_operations;
};
class __list2slist_stack_info
: public __list2slist_info
{
public:
__list2slist_stack_info(const __list2slist_info& __o)
: __list2slist_info(__o) { }
};
class __trace_list_to_slist
: public __trace_base<__list2slist_info, __list2slist_stack_info>
{
public:
~__trace_list_to_slist() { }
__trace_list_to_slist()
: __trace_base<__list2slist_info, __list2slist_stack_info>()
{ __id = "list-to-slist"; }
void
__destruct(__list2slist_info* __obj_info)
{ __retire_object(__obj_info); }
};
inline void
__trace_list_to_slist_init()
{ _GLIBCXX_PROFILE_DATA(_S_list_to_slist) = new __trace_list_to_slist(); }
inline void
__trace_list_to_slist_free()
{ delete _GLIBCXX_PROFILE_DATA(_S_list_to_slist); }
inline void
__trace_list_to_slist_report(FILE* __f, __warning_vector_t& __warnings)
{ __trace_report(_GLIBCXX_PROFILE_DATA(_S_list_to_slist), __f, __warnings); }
inline __list2slist_info*
__trace_list_to_slist_construct()
{
if (!__profcxx_init())
return 0;
if (!__reentrance_guard::__get_in())
return 0;
__reentrance_guard __get_out;
return _GLIBCXX_PROFILE_DATA(_S_list_to_slist)->__add_object(__get_stack());
}
inline void
__trace_list_to_slist_rewind(__list2slist_info* __obj_info)
{
if (!__obj_info)
return;
__obj_info->__opr_rewind();
}
inline void
__trace_list_to_slist_operation(__list2slist_info* __obj_info)
{
if (!__obj_info)
return;
__obj_info->__record_operation();
}
inline void
__trace_list_to_slist_destruct(__list2slist_info* __obj_info)
{
if (!__obj_info)
return;
_GLIBCXX_PROFILE_DATA(_S_list_to_slist)->__destruct(__obj_info);
}
} // namespace __gnu_profile
#endif /* _GLIBCXX_PROFILE_PROFILER_LIST_TO_SLIST_H */
// -*- C++ -*-
//
// Copyright (C) 2009-2019 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 3, or (at your option)
// any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// Under Section 7 of GPL version 3, you are granted additional
// permissions described in the GCC Runtime Library Exception, version
// 3.1, as published by the Free Software Foundation.
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
/** @file profile/impl/profiler_list_to_vector.h
* @brief diagnostics for list to vector.
*/
// Written by Changhee Jung.
#ifndef _GLIBCXX_PROFILE_PROFILER_LIST_TO_VECTOR_H
#define _GLIBCXX_PROFILE_PROFILER_LIST_TO_VECTOR_H 1
#include <sstream>
#include "profile/impl/profiler.h"
#include "profile/impl/profiler_node.h"
#include "profile/impl/profiler_trace.h"
namespace __gnu_profile
{
/** @brief A list-to-vector instrumentation line in the object table. */
class __list2vector_info
: public __object_info_base
{
public:
__list2vector_info(__stack_t __stack)
: __object_info_base(__stack), _M_shift_count(0), _M_iterate(0),
_M_resize(0), _M_list_cost(0), _M_vector_cost(0),
_M_max_size(0) { }
void
__merge(const __list2vector_info& __o)
{
__object_info_base::__merge(__o);
_M_shift_count += __o._M_shift_count;
_M_iterate += __o._M_iterate;
_M_vector_cost += __o._M_vector_cost;
_M_list_cost += __o._M_list_cost;
_M_resize += __o._M_resize;
_M_max_size = std::max( _M_max_size, __o._M_max_size);
}
void
__write(FILE* __f) const
{
std::fprintf(__f, "%Zu %Zu %Zu %.0f %.0f\n", _M_shift_count,
_M_resize, _M_iterate, _M_vector_cost, _M_list_cost);
}
float
__magnitude() const
{ return _M_list_cost - _M_vector_cost; }
std::string
__advice() const
{
std::stringstream __sstream;
__sstream
<< "change std::list to std::vector and its initial size from 0 to "
<< _M_max_size;
return __sstream.str();
}
std::size_t
__shift_count()
{ return _M_shift_count; }
std::size_t
__iterate()
{ return _M_iterate; }
float
__list_cost()
{ return _M_list_cost; }
std::size_t
__resize()
{ return _M_resize; }
void
__set_list_cost(float __lc)
{ _M_list_cost = __lc; }
void
__set_vector_cost(float __vc)
{ _M_vector_cost = __vc; }
void
__opr_insert(std::size_t __shift, std::size_t __size)
{
_M_shift_count += __shift;
_M_max_size = std::max(_M_max_size, __size);
}
void
__opr_iterate(int __num)
{ __gnu_cxx::__atomic_add(&_M_iterate, __num); }
void
__resize(std::size_t __from, std::size_t)
{ _M_resize += __from; }
private:
std::size_t _M_shift_count;
mutable _Atomic_word _M_iterate;
std::size_t _M_resize;
float _M_list_cost;
float _M_vector_cost;
std::size_t _M_max_size;
};
class __list2vector_stack_info
: public __list2vector_info
{
public:
__list2vector_stack_info(const __list2vector_info& __o)
: __list2vector_info(__o) {}
};
class __trace_list_to_vector
: public __trace_base<__list2vector_info, __list2vector_stack_info>
{
public:
__trace_list_to_vector()
: __trace_base<__list2vector_info, __list2vector_stack_info>()
{ __id = "list-to-vector"; }
~__trace_list_to_vector() { }
// Call at destruction/clean to set container final size.
void
__destruct(__list2vector_info* __obj_info)
{
float __vc = __vector_cost(__obj_info->__shift_count(),
__obj_info->__iterate());
float __lc = __list_cost(__obj_info->__shift_count(),
__obj_info->__iterate());
__obj_info->__set_vector_cost(__vc);
__obj_info->__set_list_cost(__lc);
__retire_object(__obj_info);
}
// Collect cost of operations.
float
__vector_cost(std::size_t __shift, std::size_t __iterate)
{
// The resulting vector will use a 'reserve' method.
return (__shift
* _GLIBCXX_PROFILE_DATA(__vector_shift_cost_factor).__value
+ __iterate
* _GLIBCXX_PROFILE_DATA(__vector_iterate_cost_factor).__value);
}
float
__list_cost(std::size_t __shift, std::size_t __iterate)
{
return (__shift
* _GLIBCXX_PROFILE_DATA(__list_shift_cost_factor).__value
+ __iterate
* _GLIBCXX_PROFILE_DATA(__list_iterate_cost_factor).__value);
}
};
inline void
__trace_list_to_vector_init()
{ _GLIBCXX_PROFILE_DATA(_S_list_to_vector) = new __trace_list_to_vector(); }
inline void
__trace_list_to_vector_free()
{ delete _GLIBCXX_PROFILE_DATA(_S_list_to_vector); }
inline void
__trace_list_to_vector_report(FILE* __f, __warning_vector_t& __warnings)
{ __trace_report(_GLIBCXX_PROFILE_DATA(_S_list_to_vector), __f, __warnings); }
inline __list2vector_info*
__trace_list_to_vector_construct()
{
if (!__profcxx_init())
return 0;
if (!__reentrance_guard::__get_in())
return 0;
__reentrance_guard __get_out;
return _GLIBCXX_PROFILE_DATA(_S_list_to_vector)
->__add_object(__get_stack());
}
inline void
__trace_list_to_vector_insert(__list2vector_info* __obj_info,
std::size_t __shift, std::size_t __size)
{
if (!__obj_info)
return;
__obj_info->__opr_insert(__shift, __size);
}
inline void
__trace_list_to_vector_iterate(__list2vector_info* __obj_info,
int)
{
if (!__obj_info)
return;
// We only collect if an iteration took place no matter in what side.
__obj_info->__opr_iterate(1);
}
inline void
__trace_list_to_vector_invalid_operator(__list2vector_info* __obj_info)
{
if (!__obj_info)
return;
__obj_info->__set_invalid();
}
inline void
__trace_list_to_vector_resize(__list2vector_info* __obj_info,
std::size_t __from, std::size_t __to)
{
if (!__obj_info)
return;
__obj_info->__resize(__from, __to);
}
inline void
__trace_list_to_vector_destruct(__list2vector_info* __obj_info)
{
if (!__obj_info)
return;
_GLIBCXX_PROFILE_DATA(_S_list_to_vector)->__destruct(__obj_info);
}
} // namespace __gnu_profile
#endif /* _GLIBCXX_PROFILE_PROFILER_LIST_TO_VECTOR_H__ */
// -*- C++ -*-
//
// Copyright (C) 2009-2019 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 3, or (at your option)
// any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// Under Section 7 of GPL version 3, you are granted additional
// permissions described in the GCC Runtime Library Exception, version
// 3.1, as published by the Free Software Foundation.
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
/** @file profile/impl/profiler_map_to_unordered_map.h
* @brief Diagnostics for map to unordered_map.
*/
// Written by Silvius Rus.
#ifndef _GLIBCXX_PROFILE_PROFILER_MAP_TO_UNORDERED_MAP_H
#define _GLIBCXX_PROFILE_PROFILER_MAP_TO_UNORDERED_MAP_H 1
#include "profile/impl/profiler.h"
#include "profile/impl/profiler_node.h"
#include "profile/impl/profiler_trace.h"
namespace __gnu_profile
{
inline int
__log2(std::size_t __size)
{
for (int __bit_count = sizeof(std::size_t) - 1; __bit_count >= 0;
-- __bit_count)
if ((2 << __bit_count) & __size)
return __bit_count;
return 0;
}
inline float
__map_insert_cost(std::size_t __size)
{ return (_GLIBCXX_PROFILE_DATA(__map_insert_cost_factor).__value
* static_cast<float>(__log2(__size))); }
inline float
__map_erase_cost(std::size_t __size)
{ return (_GLIBCXX_PROFILE_DATA(__map_erase_cost_factor).__value
* static_cast<float>(__log2(__size))); }
inline float
__map_find_cost(std::size_t __size)
{ return (_GLIBCXX_PROFILE_DATA(__map_find_cost_factor).__value
* static_cast<float>(__log2(__size))); }
/** @brief A map-to-unordered_map instrumentation line in the
object table. */
class __map2umap_info
: public __object_info_base
{
public:
__map2umap_info(__stack_t __stack)
: __object_info_base(__stack), _M_insert(0), _M_erase(0), _M_find(0),
_M_iterate(0), _M_umap_cost(0.0), _M_map_cost(0.0)
{ }
void
__merge(const __map2umap_info& __o)
{
__object_info_base::__merge(__o);
_M_insert += __o._M_insert;
_M_erase += __o._M_erase;
_M_find += __o._M_find;
_M_iterate += __o._M_iterate;
_M_umap_cost += __o._M_umap_cost;
_M_map_cost += __o._M_map_cost;
}
void
__write(FILE* __f) const
{
std::fprintf(__f, "%Zu %Zu %Zu %Zu %.0f %.0f\n",
_M_insert, _M_erase, _M_find, _M_iterate, _M_map_cost,
_M_umap_cost);
}
float
__magnitude() const
{ return _M_map_cost - _M_umap_cost; }
std::string
__advice() const
{ return "prefer an unordered container"; }
void
__record_insert(std::size_t __size, std::size_t __count)
{
++_M_insert;
if (__count)
{
_M_map_cost += __count * __map_insert_cost(__size);
_M_umap_cost
+= (__count
* _GLIBCXX_PROFILE_DATA(__umap_insert_cost_factor).__value);
}
}
void
__record_erase(std::size_t __size, std::size_t __count)
{
++_M_erase;
if (__count)
{
_M_map_cost += __count * __map_erase_cost(__size);
_M_umap_cost
+= (__count
* _GLIBCXX_PROFILE_DATA(__umap_erase_cost_factor).__value);
}
}
void
__record_find(std::size_t __size)
{
++_M_find;
_M_map_cost += __map_find_cost(__size);
_M_umap_cost += _GLIBCXX_PROFILE_DATA(__umap_find_cost_factor).__value;
}
void
__record_iterate(int __count)
{ __gnu_cxx::__atomic_add(&_M_iterate, __count); }
void
__set_iterate_costs()
{
_M_umap_cost
+= (_M_iterate
* _GLIBCXX_PROFILE_DATA(__umap_iterate_cost_factor).__value);
_M_map_cost
+= (_M_iterate
* _GLIBCXX_PROFILE_DATA(__map_iterate_cost_factor).__value);
}
private:
std::size_t _M_insert;
std::size_t _M_erase;
std::size_t _M_find;
mutable _Atomic_word _M_iterate;
float _M_umap_cost;
float _M_map_cost;
};
/** @brief A map-to-unordered_map instrumentation line in the
stack table. */
class __map2umap_stack_info
: public __map2umap_info
{
public:
__map2umap_stack_info(const __map2umap_info& __o)
: __map2umap_info(__o) { }
};
/** @brief Map-to-unordered_map instrumentation producer. */
class __trace_map2umap
: public __trace_base<__map2umap_info, __map2umap_stack_info>
{
public:
__trace_map2umap()
: __trace_base<__map2umap_info, __map2umap_stack_info>()
{ __id = "ordered-to-unordered"; }
// Call at destruction/clean to set container final size.
void
__destruct(__map2umap_info* __obj_info)
{
__obj_info->__set_iterate_costs();
__retire_object(__obj_info);
}
};
inline void
__trace_map_to_unordered_map_init()
{ _GLIBCXX_PROFILE_DATA(_S_map2umap) = new __trace_map2umap(); }
inline void
__trace_map_to_unordered_map_free()
{ delete _GLIBCXX_PROFILE_DATA(_S_map2umap); }
inline void
__trace_map_to_unordered_map_report(FILE* __f,
__warning_vector_t& __warnings)
{ __trace_report(_GLIBCXX_PROFILE_DATA(_S_map2umap), __f, __warnings); }
inline __map2umap_info*
__trace_map_to_unordered_map_construct()
{
if (!__profcxx_init())
return 0;
if (!__reentrance_guard::__get_in())
return 0;
__reentrance_guard __get_out;
return _GLIBCXX_PROFILE_DATA(_S_map2umap)->__add_object(__get_stack());
}
inline void
__trace_map_to_unordered_map_insert(__map2umap_info* __info,
std::size_t __size, std::size_t __count)
{
if (!__info)
return;
__info->__record_insert(__size, __count);
}
inline void
__trace_map_to_unordered_map_erase(__map2umap_info* __info,
std::size_t __size, std::size_t __count)
{
if (!__info)
return;
__info->__record_erase(__size, __count);
}
inline void
__trace_map_to_unordered_map_find(__map2umap_info* __info,
std::size_t __size)
{
if (!__info)
return;
__info->__record_find(__size);
}
inline void
__trace_map_to_unordered_map_iterate(__map2umap_info* __info,
int)
{
if (!__info)
return;
// We only collect if an iteration took place no matter in what side.
__info->__record_iterate(1);
}
inline void
__trace_map_to_unordered_map_invalidate(__map2umap_info* __info)
{
if (!__info)
return;
__info->__set_invalid();
}
inline void
__trace_map_to_unordered_map_destruct(__map2umap_info* __info)
{
if (!__info)
return;
_GLIBCXX_PROFILE_DATA(_S_map2umap)->__destruct(__info);
}
} // namespace __gnu_profile
#endif /* _GLIBCXX_PROFILE_PROFILER_MAP_TO_UNORDERED_MAP_H */
// -*- C++ -*-
//
// Copyright (C) 2009-2019 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 3, or (at your option)
// any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// Under Section 7 of GPL version 3, you are granted additional
// permissions described in the GCC Runtime Library Exception, version
// 3.1, as published by the Free Software Foundation.
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
/** @file profile/impl/profiler_node.h
* @brief Data structures to represent a single profiling event.
*/
// Written by Lixia Liu and Silvius Rus.
#ifndef _GLIBCXX_PROFILE_PROFILER_NODE_H
#define _GLIBCXX_PROFILE_PROFILER_NODE_H 1
#include <cstdio> // FILE, fprintf
#include <vector>
#if defined _GLIBCXX_HAVE_EXECINFO_H
#include <execinfo.h>
#endif
namespace __gnu_profile
{
typedef void* __instruction_address_t;
typedef std::_GLIBCXX_STD_C::vector<__instruction_address_t> __stack_npt;
typedef __stack_npt* __stack_t;
std::size_t __stack_max_depth();
inline __stack_t
__get_stack()
{
#if defined _GLIBCXX_HAVE_EXECINFO_H
__try
{
std::size_t __max_depth = __stack_max_depth();
if (__max_depth == 0)
return 0;
__stack_npt __buffer(__max_depth);
int __depth = backtrace(&__buffer[0], __max_depth);
return new(std::nothrow) __stack_npt(__buffer.begin(),
__buffer.begin() + __depth);
}
__catch(...)
{
return 0;
}
#else
return 0;
#endif
}
inline std::size_t
__size(__stack_t __stack)
{
if (!__stack)
return 0;
else
return __stack->size();
}
// XXX
inline void
__write(FILE* __f, __stack_t __stack)
{
if (!__stack)
return;
__stack_npt::const_iterator __it;
for (__it = __stack->begin(); __it != __stack->end(); ++__it)
std::fprintf(__f, "%p ", *__it);
}
/** @brief Hash function for summary trace using call stack as index. */
class __stack_hash
{
public:
std::size_t
operator()(__stack_t __s) const
{
if (!__s)
return 0;
std::size_t __index = 0;
__stack_npt::const_iterator __it;
for (__it = __s->begin(); __it != __s->end(); ++__it)
__index += reinterpret_cast<std::size_t>(*__it);
return __index;
}
bool operator() (__stack_t __stack1, __stack_t __stack2) const
{
if (!__stack1 && !__stack2)
return true;
if (!__stack1 || !__stack2)
return false;
if (__stack1->size() != __stack2->size())
return false;
std::size_t __byte_size
= __stack1->size() * sizeof(__stack_npt::value_type);
return __builtin_memcmp(&(*__stack1)[0], &(*__stack2)[0],
__byte_size) == 0;
}
};
/** @brief Base class for a line in the object table. */
class __object_info_base
{
public:
__object_info_base(__stack_t __stack)
: _M_stack(__stack), _M_valid(true) { }
bool
__is_valid() const
{ return _M_valid; }
void
__set_invalid()
{ _M_valid = false; }
void
__merge(const __object_info_base& __o)
{ _M_valid &= __o._M_valid; }
__stack_t
__stack() const
{ return _M_stack; }
protected:
__stack_t _M_stack;
bool _M_valid;
};
} // namespace __gnu_profile
#endif /* _GLIBCXX_PROFILE_PROFILER_NODE_H */
// -*- C++ -*-
//
// Copyright (C) 2009-2019 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 3, or (at your option)
// any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// Under Section 7 of GPL version 3, you are granted additional
// permissions described in the GCC Runtime Library Exception, version
// 3.1, as published by the Free Software Foundation.
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
/** @file profile/impl/profiler_state.h
* @brief Global profiler state.
*/
// Written by Lixia Liu and Silvius Rus.
#ifndef _GLIBCXX_PROFILE_PROFILER_STATE_H
#define _GLIBCXX_PROFILE_PROFILER_STATE_H 1
namespace __gnu_profile
{
enum __state_type { __ON, __OFF, __INVALID };
_GLIBCXX_PROFILE_DEFINE_DATA(__state_type, __state, __INVALID);
inline bool
__turn(__state_type __s)
{
__state_type inv(__INVALID);
return __atomic_compare_exchange_n(&_GLIBCXX_PROFILE_DATA(__state),
&inv, __s, false, __ATOMIC_ACQ_REL,
__ATOMIC_RELAXED);
}
inline bool
__turn_on()
{ return __turn(__ON); }
inline bool
__turn_off()
{ return __turn(__OFF); }
inline bool
__is_on()
{ return _GLIBCXX_PROFILE_DATA(__state) == __ON; }
inline bool
__is_off()
{ return _GLIBCXX_PROFILE_DATA(__state) == __OFF; }
inline bool
__is_invalid()
{ return _GLIBCXX_PROFILE_DATA(__state) == __INVALID; }
} // end namespace __gnu_profile
#endif /* _GLIBCXX_PROFILE_PROFILER_STATE_H */
// -*- C++ -*-
//
// Copyright (C) 2009-2019 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 3, or (at your option)
// any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// Under Section 7 of GPL version 3, you are granted additional
// permissions described in the GCC Runtime Library Exception, version
// 3.1, as published by the Free Software Foundation.
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
/** @file profile/impl/profiler_vector_size.h
* @brief Collection of vector size traces.
*/
// Written by Lixia Liu and Silvius Rus.
#ifndef _GLIBCXX_PROFILE_PROFILER_VECTOR_SIZE_H
#define _GLIBCXX_PROFILE_PROFILER_VECTOR_SIZE_H 1
#include "profile/impl/profiler.h"
#include "profile/impl/profiler_node.h"
#include "profile/impl/profiler_trace.h"
#include "profile/impl/profiler_state.h"
#include "profile/impl/profiler_container_size.h"
namespace __gnu_profile
{
/** @brief Hashtable size instrumentation trace producer. */
class __trace_vector_size
: public __trace_container_size
{
public:
__trace_vector_size()
: __trace_container_size()
{ __id = "vector-size"; }
};
inline void
__trace_vector_size_init()
{ _GLIBCXX_PROFILE_DATA(_S_vector_size) = new __trace_vector_size(); }
inline void
__trace_vector_size_free()
{ delete _GLIBCXX_PROFILE_DATA(_S_vector_size); }
inline void
__trace_vector_size_report(FILE* __f, __warning_vector_t& __warnings)
{ __trace_report(_GLIBCXX_PROFILE_DATA(_S_vector_size), __f, __warnings); }
inline __container_size_info*
__trace_vector_size_construct(std::size_t __num)
{
if (!__profcxx_init())
return 0;
if (!__reentrance_guard::__get_in())
return 0;
__reentrance_guard __get_out;
return _GLIBCXX_PROFILE_DATA(_S_vector_size)->
__insert(__get_stack(), __num);
}
inline void
__trace_vector_size_resize(__container_size_info* __obj_info,
std::size_t __from, std::size_t __to)
{
if (!__obj_info)
return;
__obj_info->__resize(__from, __to);
}
inline void
__trace_vector_size_destruct(__container_size_info* __obj_info,
std::size_t __num, std::size_t __inum)
{
if (!__obj_info)
return;
_GLIBCXX_PROFILE_DATA(_S_vector_size)->
__destruct(__obj_info, __num, __inum);
}
} // namespace __gnu_profile
#endif /* _GLIBCXX_PROFILE_PROFILER_VECTOR_SIZE_H */
// -*- C++ -*-
//
// Copyright (C) 2009-2019 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 3, or (at your option)
// any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// Under Section 7 of GPL version 3, you are granted additional
// permissions described in the GCC Runtime Library Exception, version
// 3.1, as published by the Free Software Foundation.
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
/** @file profile/impl/profiler_vector_to_list.h
* @brief diagnostics for vector to list.
*/
// Written by Lixia Liu and Silvius Rus.
#ifndef _GLIBCXX_PROFILE_PROFILER_VECTOR_TO_LIST_H
#define _GLIBCXX_PROFILE_PROFILER_VECTOR_TO_LIST_H 1
#include "profile/impl/profiler.h"
#include "profile/impl/profiler_node.h"
#include "profile/impl/profiler_trace.h"
namespace __gnu_profile
{
/** @brief A vector-to-list instrumentation line in the object table. */
class __vector2list_info
: public __object_info_base
{
public:
__vector2list_info(__stack_t __stack)
: __object_info_base(__stack), _M_shift_count(0), _M_iterate(0),
_M_resize(0), _M_list_cost(0), _M_vector_cost(0)
{ }
void
__merge(const __vector2list_info& __o)
{
__object_info_base::__merge(__o);
_M_shift_count += __o._M_shift_count;
_M_iterate += __o._M_iterate;
_M_vector_cost += __o._M_vector_cost;
_M_list_cost += __o._M_list_cost;
_M_resize += __o._M_resize;
}
void
__write(FILE* __f) const
{
std::fprintf(__f, "%Zu %Zu %Zu %.0f %.0f\n", _M_shift_count,
_M_resize, _M_iterate, _M_vector_cost, _M_list_cost);
}
float
__magnitude() const
{ return _M_vector_cost - _M_list_cost; }
std::string
__advice() const
{ return "change std::vector to std::list"; }
std::size_t
__shift_count()
{ return _M_shift_count; }
std::size_t
__iterate()
{ return _M_iterate; }
float
__list_cost()
{ return _M_list_cost; }
std::size_t
__resize()
{ return _M_resize; }
void
__set_list_cost(float __lc)
{ _M_list_cost = __lc; }
void
__set_vector_cost(float __vc)
{ _M_vector_cost = __vc; }
void
__opr_insert(std::size_t __pos, std::size_t __num)
{ _M_shift_count += __num - __pos; }
void
__opr_iterate(int __num)
{ __gnu_cxx::__atomic_add(&_M_iterate, __num); }
void
__resize(std::size_t __from, std::size_t)
{ _M_resize += __from; }
private:
std::size_t _M_shift_count;
mutable _Atomic_word _M_iterate;
std::size_t _M_resize;
float _M_list_cost;
float _M_vector_cost;
};
/** @brief A vector-to-list instrumentation line in the stack table. */
class __vector2list_stack_info
: public __vector2list_info
{
public:
__vector2list_stack_info(const __vector2list_info& __o)
: __vector2list_info(__o) { }
};
/** @brief Vector-to-list instrumentation producer. */
class __trace_vector_to_list
: public __trace_base<__vector2list_info, __vector2list_stack_info>
{
public:
__trace_vector_to_list()
: __trace_base<__vector2list_info, __vector2list_stack_info>()
{ __id = "vector-to-list"; }
~__trace_vector_to_list() { }
// Call at destruction/clean to set container final size.
void
__destruct(__vector2list_info* __obj_info)
{
float __vc = __vector_cost(__obj_info->__shift_count(),
__obj_info->__iterate(),
__obj_info->__resize());
float __lc = __list_cost(__obj_info->__shift_count(),
__obj_info->__iterate(),
__obj_info->__resize());
__obj_info->__set_vector_cost(__vc);
__obj_info->__set_list_cost(__lc);
__retire_object(__obj_info);
}
// Collect cost of operations.
float
__vector_cost(std::size_t __shift, std::size_t __iterate,
std::size_t __resize)
{
return (__shift
* _GLIBCXX_PROFILE_DATA(__vector_shift_cost_factor).__value
+ __iterate
* _GLIBCXX_PROFILE_DATA(__vector_iterate_cost_factor).__value
+ __resize
* _GLIBCXX_PROFILE_DATA(__vector_resize_cost_factor).__value);
}
float
__list_cost(std::size_t __shift, std::size_t __iterate,
std::size_t __resize)
{
return (__shift
* _GLIBCXX_PROFILE_DATA(__list_shift_cost_factor).__value
+ __iterate
* _GLIBCXX_PROFILE_DATA(__list_iterate_cost_factor).__value
+ __resize
* _GLIBCXX_PROFILE_DATA(__list_resize_cost_factor).__value);
}
};
inline void
__trace_vector_to_list_init()
{ _GLIBCXX_PROFILE_DATA(_S_vector_to_list) = new __trace_vector_to_list(); }
inline void
__trace_vector_to_list_free()
{ delete _GLIBCXX_PROFILE_DATA(_S_vector_to_list); }
inline void
__trace_vector_to_list_report(FILE* __f, __warning_vector_t& __warnings)
{ __trace_report(_GLIBCXX_PROFILE_DATA(_S_vector_to_list), __f, __warnings); }
inline __vector2list_info*
__trace_vector_to_list_construct()
{
if (!__profcxx_init())
return 0;
if (!__reentrance_guard::__get_in())
return 0;
__reentrance_guard __get_out;
return _GLIBCXX_PROFILE_DATA(_S_vector_to_list)
->__add_object(__get_stack());
}
inline void
__trace_vector_to_list_insert(__vector2list_info* __obj_info,
std::size_t __pos,
std::size_t __num)
{
if (!__obj_info)
return;
__obj_info->__opr_insert(__pos, __num);
}
inline void
__trace_vector_to_list_iterate(__vector2list_info* __obj_info, int)
{
if (!__obj_info)
return;
// We only collect if an iteration took place no matter in what side.
__obj_info->__opr_iterate(1);
}
inline void
__trace_vector_to_list_invalid_operator(__vector2list_info* __obj_info)
{
if (!__obj_info)
return;
__obj_info->__set_invalid();
}
inline void
__trace_vector_to_list_resize(__vector2list_info* __obj_info,
std::size_t __from,
std::size_t __to)
{
if (!__obj_info)
return;
__obj_info->__resize(__from, __to);
}
inline void
__trace_vector_to_list_destruct(__vector2list_info* __obj_info)
{
if (!__obj_info)
return;
_GLIBCXX_PROFILE_DATA(_S_vector_to_list)->__destruct(__obj_info);
}
} // namespace __gnu_profile
#endif /* _GLIBCXX_PROFILE_PROFILER_VECTOR_TO_LIST_H */
// Profiling iterator implementation -*- C++ -*-
// Copyright (C) 2009-2019 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 3, or (at your option)
// any later version.
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// Under Section 7 of GPL version 3, you are granted additional
// permissions described in the GCC Runtime Library Exception, version
// 3.1, as published by the Free Software Foundation.
// You should have received a copy of the GNU General Public License and
// a copy of the GCC Runtime Library Exception along with this program;
// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
// <http://www.gnu.org/licenses/>.
/** @file profile/iterator_tracker.h
* This file is a GNU profile extension to the Standard C++ Library.
*/
#ifndef _GLIBCXX_PROFILE_ITERATOR_TRACKER
#define _GLIBCXX_PROFILE_ITERATOR_TRACKER 1
#include <ext/type_traits.h>
namespace std _GLIBCXX_VISIBILITY(default)
{
namespace __profile
{
template<typename _Iterator, typename _Sequence>
class __iterator_tracker
{
typedef __iterator_tracker _Self;
// The underlying iterator
_Iterator _M_current;
// The underlying data structure
const _Sequence* _M_ds;
typedef std::iterator_traits<_Iterator> _Traits;
public:
typedef _Iterator _Base_iterator;
typedef typename _Traits::iterator_category iterator_category;
typedef typename _Traits::value_type value_type;
typedef typename _Traits::difference_type difference_type;
typedef typename _Traits::reference reference;
typedef typename _Traits::pointer pointer;
__iterator_tracker() _GLIBCXX_NOEXCEPT
: _M_current(), _M_ds(0) { }
__iterator_tracker(const _Iterator& __i, const _Sequence* __seq)
_GLIBCXX_NOEXCEPT
: _M_current(__i), _M_ds(__seq) { }
__iterator_tracker(const __iterator_tracker& __x) _GLIBCXX_NOEXCEPT
: _M_current(__x._M_current), _M_ds(__x._M_ds) { }
template<typename _MutableIterator>
__iterator_tracker(const __iterator_tracker<_MutableIterator,
typename __gnu_cxx::__enable_if
<(std::__are_same<_MutableIterator, typename
_Sequence::iterator::_Base_iterator>::__value),
_Sequence>::__type>& __x) _GLIBCXX_NOEXCEPT
: _M_current(__x.base()), _M_ds(__x._M_get_sequence()) { }
_Iterator
base() const _GLIBCXX_NOEXCEPT { return _M_current; }
/**
* @brief Conversion to underlying non-debug iterator to allow
* better interaction with non-profile containers.
*/
operator _Iterator() const _GLIBCXX_NOEXCEPT { return _M_current; }
pointer
operator->() const _GLIBCXX_NOEXCEPT { return &*_M_current; }
__iterator_tracker&
operator++() _GLIBCXX_NOEXCEPT
{
_M_ds->_M_profile_iterate();
++_M_current;
return *this;
}
__iterator_tracker
operator++(int) _GLIBCXX_NOEXCEPT
{
_M_ds->_M_profile_iterate();
__iterator_tracker __tmp(*this);
++_M_current;
return __tmp;
}
__iterator_tracker&
operator--() _GLIBCXX_NOEXCEPT
{
_M_ds->_M_profile_iterate(1);
--_M_current;
return *this;
}
__iterator_tracker
operator--(int) _GLIBCXX_NOEXCEPT
{
_M_ds->_M_profile_iterate(1);
__iterator_tracker __tmp(*this);
--_M_current;
return __tmp;
}
__iterator_tracker&
operator=(const __iterator_tracker& __x) _GLIBCXX_NOEXCEPT
{
_M_current = __x._M_current;
_M_ds = __x._M_ds;
return *this;
}
reference
operator*() const _GLIBCXX_NOEXCEPT
{ return *_M_current; }
// ------ Random access iterator requirements ------
reference
operator[](const difference_type& __n) const _GLIBCXX_NOEXCEPT
{ return _M_current[__n]; }
__iterator_tracker&
operator+=(const difference_type& __n) _GLIBCXX_NOEXCEPT
{
_M_current += __n;
return *this;
}
__iterator_tracker
operator+(const difference_type& __n) const _GLIBCXX_NOEXCEPT
{
__iterator_tracker __tmp(*this);
__tmp += __n;
return __tmp;
}
__iterator_tracker&
operator-=(const difference_type& __n) _GLIBCXX_NOEXCEPT
{
_M_current += -__n;
return *this;
}
__iterator_tracker
operator-(const difference_type& __n) const _GLIBCXX_NOEXCEPT
{
__iterator_tracker __tmp(*this);
__tmp -= __n;
return __tmp;
}
const _Sequence*
_M_get_sequence() const
{ return static_cast<const _Sequence*>(_M_ds); }
};
template<typename _IteratorL, typename _IteratorR, typename _Sequence>
inline bool
operator==(const __iterator_tracker<_IteratorL, _Sequence>& __lhs,
const __iterator_tracker<_IteratorR, _Sequence>& __rhs)
_GLIBCXX_NOEXCEPT
{ return __lhs.base() == __rhs.base(); }
template<typename _Iterator, typename _Sequence>
inline bool
operator==(const __iterator_tracker<_Iterator, _Sequence>& __lhs,
const __iterator_tracker<_Iterator, _Sequence>& __rhs)
_GLIBCXX_NOEXCEPT
{ return __lhs.base() == __rhs.base(); }
template<typename _IteratorL, typename _IteratorR, typename _Sequence>
inline bool
operator!=(const __iterator_tracker<_IteratorL, _Sequence>& __lhs,
const __iterator_tracker<_IteratorR, _Sequence>& __rhs)
_GLIBCXX_NOEXCEPT
{ return __lhs.base() != __rhs.base(); }
template<typename _Iterator, typename _Sequence>
inline bool
operator!=(const __iterator_tracker<_Iterator, _Sequence>& __lhs,
const __iterator_tracker<_Iterator, _Sequence>& __rhs)
_GLIBCXX_NOEXCEPT
{ return __lhs.base() != __rhs.base(); }
template<typename _IteratorL, typename _IteratorR, typename _Sequence>
inline bool
operator<(const __iterator_tracker<_IteratorL, _Sequence>& __lhs,
const __iterator_tracker<_IteratorR, _Sequence>& __rhs)
_GLIBCXX_NOEXCEPT
{ return __lhs.base() < __rhs.base(); }
template<typename _Iterator, typename _Sequence>
inline bool
operator<(const __iterator_tracker<_Iterator, _Sequence>& __lhs,
const __iterator_tracker<_Iterator, _Sequence>& __rhs)
_GLIBCXX_NOEXCEPT
{ return __lhs.base() < __rhs.base(); }
template<typename _IteratorL, typename _IteratorR, typename _Sequence>
inline bool
operator<=(const __iterator_tracker<_IteratorL, _Sequence>& __lhs,
const __iterator_tracker<_IteratorR, _Sequence>& __rhs)
_GLIBCXX_NOEXCEPT
{ return __lhs.base() <= __rhs.base(); }
template<typename _Iterator, typename _Sequence>
inline bool
operator<=(const __iterator_tracker<_Iterator, _Sequence>& __lhs,
const __iterator_tracker<_Iterator, _Sequence>& __rhs)
_GLIBCXX_NOEXCEPT
{ return __lhs.base() <= __rhs.base(); }
template<typename _IteratorL, typename _IteratorR, typename _Sequence>
inline bool
operator>(const __iterator_tracker<_IteratorL, _Sequence>& __lhs,
const __iterator_tracker<_IteratorR, _Sequence>& __rhs)
_GLIBCXX_NOEXCEPT
{ return __lhs.base() > __rhs.base(); }
template<typename _Iterator, typename _Sequence>
inline bool
operator>(const __iterator_tracker<_Iterator, _Sequence>& __lhs,
const __iterator_tracker<_Iterator, _Sequence>& __rhs)
_GLIBCXX_NOEXCEPT
{ return __lhs.base() > __rhs.base(); }
template<typename _IteratorL, typename _IteratorR, typename _Sequence>
inline bool
operator>=(const __iterator_tracker<_IteratorL, _Sequence>& __lhs,
const __iterator_tracker<_IteratorR, _Sequence>& __rhs)
_GLIBCXX_NOEXCEPT
{ return __lhs.base() >= __rhs.base(); }
template<typename _Iterator, typename _Sequence>
inline bool
operator>=(const __iterator_tracker<_Iterator, _Sequence>& __lhs,
const __iterator_tracker<_Iterator, _Sequence>& __rhs)
_GLIBCXX_NOEXCEPT
{ return __lhs.base() >= __rhs.base(); }
// _GLIBCXX_RESOLVE_LIB_DEFECTS
// According to the resolution of DR179 not only the various comparison
// operators but also operator- must accept mixed iterator/const_iterator
// parameters.
template<typename _IteratorL, typename _IteratorR, typename _Sequence>
inline typename __iterator_tracker<_IteratorL, _Sequence>::difference_type
operator-(const __iterator_tracker<_IteratorL, _Sequence>& __lhs,
const __iterator_tracker<_IteratorR, _Sequence>& __rhs)
_GLIBCXX_NOEXCEPT
{ return __lhs.base() - __rhs.base(); }
template<typename _Iterator, typename _Sequence>
inline typename __iterator_tracker<_Iterator, _Sequence>::difference_type
operator-(const __iterator_tracker<_Iterator, _Sequence>& __lhs,
const __iterator_tracker<_Iterator, _Sequence>& __rhs)
_GLIBCXX_NOEXCEPT
{ return __lhs.base() - __rhs.base(); }
template<typename _Iterator, typename _Sequence>
inline __iterator_tracker<_Iterator, _Sequence>
operator+(typename __iterator_tracker<_Iterator,_Sequence>::difference_type
__n,
const __iterator_tracker<_Iterator, _Sequence>& __i)
_GLIBCXX_NOEXCEPT
{ return __i + __n; }
} // namespace __profile
} // namespace std
#endif
// Profiling map/multimap implementation -*- C++ -*-
// Copyright (C) 2009-2019 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 3, or (at your option)
// any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// Under Section 7 of GPL version 3, you are granted additional
// permissions described in the GCC Runtime Library Exception, version
// 3.1, as published by the Free Software Foundation.
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
/** @file profile/map
* This file is a GNU profile extension to the Standard C++ Library.
*/
#ifndef _GLIBCXX_PROFILE_MAP
#define _GLIBCXX_PROFILE_MAP 1
#include <map>
#include <profile/map.h>
#include <profile/multimap.h>
#endif
// Profiling unordered containers implementation details -*- C++ -*-
// Copyright (C) 2014-2019 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 3, or (at your option)
// any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// Under Section 7 of GPL version 3, you are granted additional
// permissions described in the GCC Runtime Library Exception, version
// 3.1, as published by the Free Software Foundation.
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
/** @file profile/ordered_base.h
* This file is a GNU profile extension to the Standard C++ Library.
*/
#ifndef _GLIBCXX_PROFILE_ORDERED
#define _GLIBCXX_PROFILE_ORDERED 1
namespace std _GLIBCXX_VISIBILITY(default)
{
namespace __profile
{
template<typename _Cont>
class _Ordered_profile
{
public:
void
_M_profile_iterate(int __rewind = 0) const
{ __profcxx_map2umap_iterate(this->_M_map2umap_info, __rewind); }
protected:
_Ordered_profile() _GLIBCXX_NOEXCEPT
{ _M_profile_construct(); }
#if __cplusplus >= 201103L
_Ordered_profile(const _Ordered_profile&) noexcept
: _Ordered_profile() { }
_Ordered_profile(_Ordered_profile&& __other) noexcept
: _Ordered_profile()
{ _M_swap(__other); }
_Ordered_profile&
operator=(const _Ordered_profile&) noexcept
{
_M_profile_destruct();
_M_profile_construct();
}
_Ordered_profile&
operator=(_Ordered_profile&& __other) noexcept
{
_M_swap(__other);
__other._M_profile_destruct();
__other._M_profile_construct();
}
#endif
~_Ordered_profile()
{ _M_profile_destruct(); }
void
_M_profile_construct() _GLIBCXX_NOEXCEPT
{ _M_map2umap_info = __profcxx_map2umap_construct(); }
void
_M_profile_destruct() _GLIBCXX_NOEXCEPT
{
__profcxx_map2umap_destruct(_M_map2umap_info);
_M_map2umap_info = 0;
}
void
_M_swap(_Ordered_profile& __other)
{ std::swap(_M_map2umap_info, __other._M_map2umap_info); }
__gnu_profile::__map2umap_info* _M_map2umap_info;
private:
_Cont&
_M_conjure()
{ return *static_cast<_Cont*>(this); }
};
} // namespace __profile
} // namespace std
#endif
// Profiling set/multiset implementation -*- C++ -*-
// Copyright (C) 2009-2019 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 3, or (at your option)
// any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// Under Section 7 of GPL version 3, you are granted additional
// permissions described in the GCC Runtime Library Exception, version
// 3.1, as published by the Free Software Foundation.
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
/** @file profile/set
* This file is a GNU profile extension to the Standard C++ Library.
*/
#ifndef _GLIBCXX_PROFILE_SET
#define _GLIBCXX_PROFILE_SET 1
#include <set>
#include <profile/set.h>
#include <profile/multiset.h>
#endif
// Profiling unordered containers implementation details -*- C++ -*-
// Copyright (C) 2013-2019 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 3, or (at your option)
// any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// Under Section 7 of GPL version 3, you are granted additional
// permissions described in the GCC Runtime Library Exception, version
// 3.1, as published by the Free Software Foundation.
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
/** @file profile/unordered_base.h
* This file is a GNU profile extension to the Standard C++ Library.
*/
#ifndef _GLIBCXX_PROFILE_UNORDERED
#define _GLIBCXX_PROFILE_UNORDERED 1
namespace std _GLIBCXX_VISIBILITY(default)
{
namespace __profile
{
template<typename _UnorderedCont,
typename _Value, bool _Cache_hash_code>
struct _Bucket_index_helper;
template<typename _UnorderedCont, typename _Value>
struct _Bucket_index_helper<_UnorderedCont, _Value, true>
{
static std::size_t
bucket(const _UnorderedCont& __uc,
const __detail::_Hash_node<_Value, true>* __node)
{ return __node->_M_hash_code % __uc.bucket_count(); }
};
template<typename _UnorderedCont, typename _Value>
struct _Bucket_index_helper<_UnorderedCont, _Value, false>
{
static std::size_t
bucket(const _UnorderedCont& __uc,
const __detail::_Hash_node<_Value, false>* __node)
{ return __uc.bucket(__node->_M_v()); }
};
template<typename _UnorderedCont, typename _Key, typename _Mapped>
struct _Bucket_index_helper<_UnorderedCont,
std::pair<const _Key, _Mapped>, false>
{
typedef std::pair<const _Key, _Mapped> _Value;
static std::size_t
bucket(const _UnorderedCont& __uc,
const __detail::_Hash_node<_Value, false>* __node)
{ return __uc.bucket(__node->_M_v().first); }
};
template<typename _UnorderedCont, typename _Value, bool _Cache_hash_code>
std::size_t
__get_bucket_index(const _UnorderedCont& __uc,
const __detail::_Hash_node<_Value, _Cache_hash_code>* __node)
{
using __bucket_index_helper
= _Bucket_index_helper<_UnorderedCont, _Value, _Cache_hash_code>;
return __bucket_index_helper::bucket(__uc, __node);
}
template<typename _UnorderedCont,
typename _Value, bool _Cache_hash_code>
struct _Equal_helper;
template<typename _UnorderedCont, typename _Value>
struct _Equal_helper<_UnorderedCont, _Value, true>
{
static std::size_t
are_equal(const _UnorderedCont& __uc,
const __detail::_Hash_node<_Value, true>* __lhs,
const __detail::_Hash_node<_Value, true>* __rhs)
{
return __lhs->_M_hash_code == __rhs->_M_hash_code
&& __uc.key_eq()(__lhs->_M_v(), __rhs->_M_v());
}
};
template<typename _UnorderedCont,
typename _Value>
struct _Equal_helper<_UnorderedCont, _Value, false>
{
static std::size_t
are_equal(const _UnorderedCont& __uc,
const __detail::_Hash_node<_Value, false>* __lhs,
const __detail::_Hash_node<_Value, false>* __rhs)
{ return __uc.key_eq()(__lhs->_M_v(), __rhs->_M_v()); }
};
template<typename _UnorderedCont,
typename _Key, typename _Mapped>
struct _Equal_helper<_UnorderedCont, std::pair<const _Key, _Mapped>, true>
{
typedef std::pair<const _Key, _Mapped> _Value;
static std::size_t
are_equal(const _UnorderedCont& __uc,
const __detail::_Hash_node<_Value, true>* __lhs,
const __detail::_Hash_node<_Value, true>* __rhs)
{
return __lhs->_M_hash_code == __rhs->_M_hash_code
&& __uc.key_eq()(__lhs->_M_v().first, __rhs->_M_v().first);
}
};
template<typename _UnorderedCont,
typename _Key, typename _Mapped>
struct _Equal_helper<_UnorderedCont, std::pair<const _Key, _Mapped>, false>
{
typedef std::pair<const _Key, _Mapped> _Value;
static std::size_t
are_equal(const _UnorderedCont& __uc,
const __detail::_Hash_node<_Value, false>* __lhs,
const __detail::_Hash_node<_Value, false>* __rhs)
{ return __uc.key_eq()(__lhs->_M_v().first, __rhs->_M_v().first); }
};
template<typename _UnorderedCont, typename _Value, bool _Cache_hash_code>
bool
__are_equal(const _UnorderedCont& __uc,
const __detail::_Hash_node<_Value, _Cache_hash_code>* __lhs,
const __detail::_Hash_node<_Value, _Cache_hash_code>* __rhs)
{
using __equal_helper
= _Equal_helper<_UnorderedCont, _Value, _Cache_hash_code>;
return __equal_helper::are_equal(__uc, __lhs, __rhs);
}
template<typename _UnorderedCont, bool _Unique_keys>
class _Unordered_profile
{
_UnorderedCont&
_M_conjure()
{ return *(static_cast<_UnorderedCont*>(this)); }
using __unique_keys = std::integral_constant<bool, _Unique_keys>;
protected:
_Unordered_profile() noexcept
{ _M_profile_construct(); }
_Unordered_profile(const _Unordered_profile&) noexcept
: _Unordered_profile() { }
_Unordered_profile(_Unordered_profile&& __other) noexcept
: _Unordered_profile()
{ _M_swap(__other); }
~_Unordered_profile()
{ _M_profile_destruct(); }
_Unordered_profile&
operator=(const _Unordered_profile&) noexcept
{
// Assignment just reset profiling.
_M_profile_destruct();
_M_profile_construct();
}
_Unordered_profile&
operator=(_Unordered_profile&& __other) noexcept
{
// Take profiling of the moved instance...
_M_swap(__other);
// ...and then reset other instance profiling.
__other._M_profile_destruct();
__other._M_profile_construct();
}
void
_M_profile_construct() noexcept
{
auto& __uc = _M_conjure();
_M_size_info = __profcxx_hashtable_size_construct(__uc.bucket_count());
_M_hashfunc_info = __profcxx_hash_func_construct();
}
void
_M_profile_destruct() noexcept
{
auto& __uc = _M_conjure();
__profcxx_hashtable_size_destruct(_M_size_info,
__uc.bucket_count(), __uc.size());
_M_size_info = 0;
if (!_M_hashfunc_info)
return;
_M_profile_destruct(__unique_keys());
_M_hashfunc_info = 0;
}
void
_M_swap(_Unordered_profile& __other) noexcept
{
std::swap(_M_size_info, __other._M_size_info);
std::swap(_M_hashfunc_info, __other._M_hashfunc_info);
}
void
_M_profile_resize(std::size_t __old_size)
{
auto __new_size = _M_conjure().bucket_count();
if (__old_size != __new_size)
__profcxx_hashtable_size_resize(_M_size_info, __old_size, __new_size);
}
__gnu_profile::__container_size_info* _M_size_info;
__gnu_profile::__hashfunc_info* _M_hashfunc_info;
private:
void
_M_profile_destruct(std::true_type);
void
_M_profile_destruct(std::false_type);
};
template<typename _UnorderedCont, bool _Unique_keys>
void
_Unordered_profile<_UnorderedCont, _Unique_keys>::
_M_profile_destruct(std::true_type)
{
auto& __uc = _M_conjure();
std::size_t __hops = 0, __lc = 0, __chain = 0;
auto __it = __uc.begin();
while (__it != __uc.end())
{
auto __bkt = __get_bucket_index(__uc, __it._M_cur);
auto __lit = __uc.begin(__bkt);
auto __lend = __uc.end(__bkt);
for (++__it, ++__lit; __lit != __lend; ++__it, ++__lit)
++__chain;
if (__chain)
{
++__chain;
__lc = __lc > __chain ? __lc : __chain;
__hops += __chain * (__chain - 1) / 2;
__chain = 0;
}
}
__profcxx_hash_func_destruct(_M_hashfunc_info,
__lc, __uc.size(), __hops);
}
template<typename _UnorderedCont, bool _Unique_keys>
void
_Unordered_profile<_UnorderedCont, _Unique_keys>::
_M_profile_destruct(std::false_type)
{
auto& __uc = _M_conjure();
std::size_t __hops = 0, __lc = 0, __chain = 0, __unique_size = 0;
auto __it = __uc.begin();
while (__it != __uc.end())
{
auto __bkt = __get_bucket_index(__uc, __it._M_cur);
auto __lit = __uc.begin(__bkt);
auto __lend = __uc.end(__bkt);
auto __pit = __it;
++__unique_size;
for (++__it, ++__lit; __lit != __lend; ++__it, ++__lit)
{
if (!__are_equal(__uc, __pit._M_cur, __it._M_cur))
{
++__chain;
++__unique_size;
__pit = __it;
}
}
if (__chain)
{
++__chain;
__lc = __lc > __chain ? __lc : __chain;
__hops += __chain * (__chain - 1) / 2;
__chain = 0;
}
}
__profcxx_hash_func_destruct(_M_hashfunc_info,
__lc, __unique_size, __hops);
}
} // namespace __profile
} // namespace std
#endif
...@@ -329,10 +329,6 @@ for f in *__parallel_*; do ...@@ -329,10 +329,6 @@ for f in *__parallel_*; do
newname=`echo $f | sed 's/__parallel_/__parallel::/'` newname=`echo $f | sed 's/__parallel_/__parallel::/'`
mv $f $newname mv $f $newname
done done
for f in *__profile_*; do
newname=`echo $f | sed 's/__profile_/__profile::/'`
mv $f $newname
done
# Remove inline namespaces used for versioning. # Remove inline namespaces used for versioning.
for f in *_V2_*; do for f in *_V2_*; do
...@@ -376,10 +372,6 @@ for f in __gnu_parallel_*; do ...@@ -376,10 +372,6 @@ for f in __gnu_parallel_*; do
newname=`echo $f | sed 's/^__gnu_parallel_/__gnu_parallel::/'` newname=`echo $f | sed 's/^__gnu_parallel_/__gnu_parallel::/'`
mv $f $newname mv $f $newname
done done
for f in __gnu_profile_*; do
newname=`echo $f | sed 's/^__gnu_profile_/__gnu_profile::/'`
mv $f $newname
done
for f in __gnu_pbds_*; do for f in __gnu_pbds_*; do
newname=`echo $f | sed 's/^__gnu_pbds_/__gnu_pbds::/'` newname=`echo $f | sed 's/^__gnu_pbds_/__gnu_pbds::/'`
mv $f $newname mv $f $newname
......
...@@ -21,7 +21,6 @@ ...@@ -21,7 +21,6 @@
#include <array> #include <array>
#include <debug/array> #include <debug/array>
#include <profile/array>
#include <memory> #include <memory>
struct A; struct A;
...@@ -32,6 +31,3 @@ auto b = std::get<0>(std::move(a)); ...@@ -32,6 +31,3 @@ auto b = std::get<0>(std::move(a));
std::__debug::array<B<A>*, 1> c; std::__debug::array<B<A>*, 1> c;
auto d = std::__debug::get<0>(std::move(c)); auto d = std::__debug::get<0>(std::move(c));
std::__profile::array<B<A>*, 1> e;
auto f = std::__profile::get<0>(std::move(e));
// { dg-options "-std=gnu++17" } // { dg-options "-std=gnu++17" }
// { dg-do compile } // { dg-do compile }
// { dg-skip-if "" { *-*-* } { "-D_GLIBCXX_PROFILE" } }
// Copyright (C) 2016-2019 Free Software Foundation, Inc. // Copyright (C) 2016-2019 Free Software Foundation, Inc.
// //
......
...@@ -34,7 +34,7 @@ test01() ...@@ -34,7 +34,7 @@ test01()
fld.resize(0); fld.resize(0);
VERIFY(fld.empty() == true); VERIFY(fld.empty() == true);
#if defined(_GLIBCXX_DEBUG) || defined(_GLIBCXX_PROFILE) #ifdef _GLIBCXX_DEBUG
using std::_GLIBCXX_STD_C::_Fwd_list_node; using std::_GLIBCXX_STD_C::_Fwd_list_node;
#else #else
using std::_Fwd_list_node; using std::_Fwd_list_node;
......
...@@ -26,10 +26,10 @@ void test01() ...@@ -26,10 +26,10 @@ void test01()
typedef std::list<int> list_type; typedef std::list<int> list_type;
list_type l; list_type l;
#if ! defined _GLIBCXX_DEBUG && ! defined _GLIBCXX_PROFILE #ifdef _GLIBCXX_DEBUG
using std::_List_node;
#else
using std::_GLIBCXX_STD_C::_List_node; using std::_GLIBCXX_STD_C::_List_node;
#else
using std::_List_node;
#endif #endif
VERIFY( l.max_size() == std::allocator<_List_node<int> >().max_size() ); VERIFY( l.max_size() == std::allocator<_List_node<int> >().max_size() );
......
...@@ -16,7 +16,6 @@ ...@@ -16,7 +16,6 @@
// <http://www.gnu.org/licenses/>. // <http://www.gnu.org/licenses/>.
// { dg-options "-std=gnu++17" } // { dg-options "-std=gnu++17" }
// { dg-skip-if "" { *-*-* } { "-D_GLIBCXX_PROFILE" } }
#include <map> #include <map>
#include <algorithm> #include <algorithm>
......
// { dg-options "-std=gnu++17" } // { dg-options "-std=gnu++17" }
// { dg-skip-if "" { *-*-* } { "-D_GLIBCXX_PROFILE" } }
// Copyright (C) 2015-2019 Free Software Foundation, Inc. // Copyright (C) 2015-2019 Free Software Foundation, Inc.
// //
......
// { dg-options "-std=gnu++17" } // { dg-options "-std=gnu++17" }
// { dg-skip-if "" { *-*-* } { "-D_GLIBCXX_PROFILE" } }
// Copyright (C) 2015-2019 Free Software Foundation, Inc. // Copyright (C) 2015-2019 Free Software Foundation, Inc.
// //
......
...@@ -16,7 +16,6 @@ ...@@ -16,7 +16,6 @@
// <http://www.gnu.org/licenses/>. // <http://www.gnu.org/licenses/>.
// { dg-options "-std=gnu++17" } // { dg-options "-std=gnu++17" }
// { dg-skip-if "" { *-*-* } { "-D_GLIBCXX_PROFILE" } }
#include <map> #include <map>
#include <algorithm> #include <algorithm>
......
...@@ -16,7 +16,6 @@ ...@@ -16,7 +16,6 @@
// <http://www.gnu.org/licenses/>. // <http://www.gnu.org/licenses/>.
// { dg-options "-std=gnu++17" } // { dg-options "-std=gnu++17" }
// { dg-skip-if "" { *-*-* } { "-D_GLIBCXX_PROFILE" } }
#include <set> #include <set>
#include <algorithm> #include <algorithm>
......
...@@ -16,7 +16,6 @@ ...@@ -16,7 +16,6 @@
// <http://www.gnu.org/licenses/>. // <http://www.gnu.org/licenses/>.
// { dg-options "-std=gnu++17" } // { dg-options "-std=gnu++17" }
// { dg-skip-if "" { *-*-* } { "-D_GLIBCXX_PROFILE" } }
#include <set> #include <set>
#include <algorithm> #include <algorithm>
......
...@@ -16,7 +16,6 @@ ...@@ -16,7 +16,6 @@
// <http://www.gnu.org/licenses/>. // <http://www.gnu.org/licenses/>.
// { dg-options "-std=gnu++17" } // { dg-options "-std=gnu++17" }
// { dg-skip-if "" { *-*-* } { "-D_GLIBCXX_PROFILE" } }
#include <unordered_map> #include <unordered_map>
#include <testsuite_hooks.h> #include <testsuite_hooks.h>
......
...@@ -16,7 +16,6 @@ ...@@ -16,7 +16,6 @@
// <http://www.gnu.org/licenses/>. // <http://www.gnu.org/licenses/>.
// { dg-options "-std=gnu++17" } // { dg-options "-std=gnu++17" }
// { dg-skip-if "" { *-*-* } { "-D_GLIBCXX_PROFILE" } }
#include <unordered_map> #include <unordered_map>
#include <testsuite_hooks.h> #include <testsuite_hooks.h>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment