r271710 - in /branches/gcc-8-branch/libstdc++-v...

redi@gcc.gnu.org redi@gcc.gnu.org
Tue May 28 14:57:00 GMT 2019


Author: redi
Date: Tue May 28 14:57:35 2019
New Revision: 271710

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

	PR libstdc++/90634
	* include/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.
	* include/experimental/bits/fs_path.h: Likewise.
	* 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.
	* src/filesystem/std-path.cc (path::_M_split_cmpts()): Likewise.

Modified:
    branches/gcc-8-branch/libstdc++-v3/ChangeLog
    branches/gcc-8-branch/libstdc++-v3/include/bits/fs_path.h
    branches/gcc-8-branch/libstdc++-v3/include/experimental/bits/fs_path.h
    branches/gcc-8-branch/libstdc++-v3/src/filesystem/path.cc
    branches/gcc-8-branch/libstdc++-v3/src/filesystem/std-path.cc



More information about the Libstdc++-cvs mailing list