r272697 - in /branches/gcc-7-branch/libstdc++-v...

redi@gcc.gnu.org redi@gcc.gnu.org
Wed Jun 26 15:12:00 GMT 2019


Author: redi
Date: Wed Jun 26 15:12:15 2019
New Revision: 272697

URL: https://gcc.gnu.org/viewcvs?rev=272697&root=gcc&view=rev
Log:
PR libstdc++/90634 reduce allocations in filesystem::path construction

Backport from mainline
2019-05-28  Jonathan Wakely  <jwakely@redhat.com>

	PR libstdc++/90634
	* include/experimental/bits/fs_path.h (path::path(path&&)): Only call
	_M_split_cmpts() for a path with multiple components.
	(path::_S_is_dir_sep()): Add missing 'static' keyword to function.
	* src/filesystem/path.cc (path::_M_split_cmpts()): Count number of
	components and reserve space in vector. Return early when there is
	only one component.
	* testsuite/experimental/filesystem/path/construct/90634.cc: New test.

Added:
    branches/gcc-7-branch/libstdc++-v3/testsuite/experimental/filesystem/path/construct/90634.cc
Modified:
    branches/gcc-7-branch/libstdc++-v3/ChangeLog
    branches/gcc-7-branch/libstdc++-v3/include/experimental/bits/fs_path.h
    branches/gcc-7-branch/libstdc++-v3/src/filesystem/path.cc



More information about the Libstdc++-cvs mailing list