gcc/libstdc++-v3
François Dumont b0c849fadb Simplify node ownership in _Hashtable members
Introduce an RAII type to manage nodes in unordered containers while
they are being inserted. If the caller always owns a node until it is
inserted, then the insertion functions don't need to deallocate on
failure. This allows a FIXME in the node re-insertion API to be removed.

Also change extract(const key_type&) to not call extract(const_iterator)
anymore.  This avoids looping through the bucket nodes again to find the
node before the one being extracted.

2019-06-17  François Dumont  <fdumont@gcc.gnu.org>
	    Jonathan Wakely  <jwakely@redhat.com>

	* include/bits/hashtable.h (struct _Hashtable::_Scoped_node): New type.
	(_Hashtable::_M_insert_unique_node): Add key_type parameter. Don't
	deallocate node if insertion fails.
	(_Hashtable::_M_insert_multi_node): Likewise.
	(_Hashtable::_M_reinsert_node): Pass additional key argument.
	(_Hashtable::_M_reinsert_node_multi): Likewise. Remove FIXME.
	(_Hashtable::_M_extract_node(size_t, __node_base*)): New function.
	(_Hashtable::extract(const_iterator)): Use _M_extract_node.
	(_Hashtable::extract(const _Key&)): Likewise.
	(_Hashtable::_M_merge_unique): Pass additional key argument.
	(_Hashtable::_M_emplace<Args>(true_type, Args&&...)): Likewise. Use
	_Scoped_node.
	(_Hashtable::_M_insert): Likewise.
	* include/bits/hashtable_policy.h (_Map_base::operator[]): Likewise.
	(_Hashtable_alloc): Add comments to functions with misleading names.

Co-Authored-By: Jonathan Wakely <jwakely@redhat.com>

From-SVN: r272381
2019-06-17 11:25:04 +01:00
..
config PR libstdc++/85494 use rdseed and rand_s in std::random_device 2019-05-29 15:45:35 +01:00
doc Corrections for C++2a library status table 2019-06-03 14:32:17 +01:00
include Simplify node ownership in _Hashtable members 2019-06-17 11:25:04 +01:00
libsupc++ PR libstdc++/90682 allow set_terminate(0) and set_unexpected(0) 2019-05-31 11:35:11 +01:00
po PR libstdc++/89466 avoid slow xsltproc command in configure 2019-02-27 11:25:44 +00:00
python PR libstdc++/90520 adjust Xmethod for recent unique_ptr changes 2019-05-18 00:08:00 +01:00
scripts Remove Profile Mode, deprecated since GCC 7.1 2019-05-13 11:50:21 +01:00
src PR libstdc++/90770 fix missing src/debug/Makefile 2019-06-07 20:57:19 +01:00
testsuite Fix tests that fail without PCH 2019-06-17 09:18:17 +01:00
acinclude.m4 PR libstdc++/85494 use rdseed and rand_s in std::random_device 2019-05-29 15:45:35 +01:00
aclocal.m4 Update GCC to autoconf 2.69, automake 1.15.1 (PR bootstrap/82856). 2018-10-31 17:03:16 +00:00
ChangeLog Simplify node ownership in _Hashtable members 2019-06-17 11:25:04 +01:00
ChangeLog-1998
ChangeLog-1999
ChangeLog-2000
ChangeLog-2001
ChangeLog-2002
ChangeLog-2003
ChangeLog-2004
ChangeLog-2005
ChangeLog-2006
ChangeLog-2007
ChangeLog-2008
ChangeLog-2009
ChangeLog-2010
ChangeLog-2011
ChangeLog-2012
ChangeLog-2013
ChangeLog-2014
ChangeLog-2015
ChangeLog-2016
ChangeLog-2017
ChangeLog-2018 Update copyright years. 2019-01-01 13:31:55 +01:00
config.h.in PR libstdc++/85494 use rdseed and rand_s in std::random_device 2019-05-29 15:45:35 +01:00
configure PR libstdc++/90770 fix missing src/debug/Makefile 2019-06-07 20:57:19 +01:00
configure.ac PR libstdc++/85494 use rdseed and rand_s in std::random_device 2019-05-29 15:45:35 +01:00
configure.host Remove obsolete Solaris 10 support 2019-05-14 17:17:23 +00:00
crossconfig.m4 PR libstdc++/89460 Fix Networking TS test failures on HP-UX 2019-03-11 16:28:11 +00:00
fragment.am PR libstdc++/86450 use -Wabi=2 and simplify -Werror use 2018-07-17 14:18:47 +01:00
linkage.m4
Makefile.am Update copyright years. 2019-01-01 13:31:55 +01:00
Makefile.in PR libstdc++/89466 avoid slow xsltproc command in configure 2019-02-27 11:25:44 +00:00
README

file: libstdc++-v3/README

New users may wish to point their web browsers to the file
index.html in the 'doc/html' subdirectory.  It contains brief
building instructions and notes on how to configure the library in
interesting ways.