]> git.ipfire.org Git - thirdparty/gcc.git/commit - libstdc++-v3/ChangeLog
PR libstdc++/90634 reduce allocations in filesystem::path construction
authorredi <redi@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 28 May 2019 19:39:48 +0000 (19:39 +0000)
committerredi <redi@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 28 May 2019 19:39:48 +0000 (19:39 +0000)
commit28d9dbe99028097cbe6e813e2faba933edcd9b83
treec1876a43ff7fce4b9302209be2ba1be30429da12
parent88c3992347091779eadeb787c1e7c47e924904d0
PR libstdc++/90634 reduce allocations in filesystem::path construction

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/27_io/filesystem/path/construct/90634.cc: New test.
* testsuite/experimental/filesystem/path/construct/90634.cc: New test.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@271717 138bc75d-0d04-0410-961f-82ee72b054a4
libstdc++-v3/ChangeLog
libstdc++-v3/include/experimental/bits/fs_path.h
libstdc++-v3/src/filesystem/path.cc
libstdc++-v3/testsuite/27_io/filesystem/path/construct/90634.cc [new file with mode: 0644]
libstdc++-v3/testsuite/experimental/filesystem/path/construct/90634.cc [new file with mode: 0644]