diff options
author | Niall Douglas (s [underscore] sourceforge {at} nedprod [dot] com) <spamtrap@nedprod.com> | 2018-10-17 21:23:18 +0300 |
---|---|---|
committer | Niall Douglas (s [underscore] sourceforge {at} nedprod [dot] com) <spamtrap@nedprod.com> | 2018-10-17 21:23:18 +0300 |
commit | fd12a60d26c80d93185ff0e0da1efa4ddbbf3863 (patch) | |
tree | cd4f6676380acf8f5d394494e6b1def7e243e8a8 /include/llfio/v2.0/algorithm | |
parent | bc1a0df70b896bc5b1852e8281aced96596b27af (diff) |
Lots of changes to support latest WG21 SG14 status code, as the erased code is now move-only, which in turn requires the async i/o completion handlers to all use rvalue refs instead of lvalue refs. This helped find and fix a fair few inefficient corner cases along the way, which is great.
Diffstat (limited to 'include/llfio/v2.0/algorithm')
3 files changed, 4 insertions, 4 deletions
diff --git a/include/llfio/v2.0/algorithm/shared_fs_mutex/atomic_append.hpp b/include/llfio/v2.0/algorithm/shared_fs_mutex/atomic_append.hpp index 9870b5cd..5e1b9807 100644 --- a/include/llfio/v2.0/algorithm/shared_fs_mutex/atomic_append.hpp +++ b/include/llfio/v2.0/algorithm/shared_fs_mutex/atomic_append.hpp @@ -205,7 +205,7 @@ namespace algorithm { if(lockresult.error() != errc::timed_out) { - return lockresult.error(); + return std::move(lockresult).error(); } // Somebody else is also using this file } diff --git a/include/llfio/v2.0/algorithm/shared_fs_mutex/lock_files.hpp b/include/llfio/v2.0/algorithm/shared_fs_mutex/lock_files.hpp index ff33520b..6534767b 100644 --- a/include/llfio/v2.0/algorithm/shared_fs_mutex/lock_files.hpp +++ b/include/llfio/v2.0/algorithm/shared_fs_mutex/lock_files.hpp @@ -174,7 +174,7 @@ namespace algorithm const auto &ec = ret.error(); if(ec != errc::resource_unavailable_try_again && ec != errc::file_exists) { - return ret.error(); + return std::move(ret).error(); } // Collided with another locker was_contended = n; diff --git a/include/llfio/v2.0/algorithm/shared_fs_mutex/memory_map.hpp b/include/llfio/v2.0/algorithm/shared_fs_mutex/memory_map.hpp index 724e0773..7f8ff236 100644 --- a/include/llfio/v2.0/algorithm/shared_fs_mutex/memory_map.hpp +++ b/include/llfio/v2.0/algorithm/shared_fs_mutex/memory_map.hpp @@ -223,13 +223,13 @@ namespace algorithm { if(lockinuse.error() != errc::timed_out) { - return lockinuse.error(); + return std::move(lockinuse).error(); } // Somebody else is also using this file, so try to read the hash index file I ought to use lockinuse = ret.lock(_lockinuseoffset, 1, false); // inuse shared access, blocking if(!lockinuse) { - return lockinuse.error(); + return std::move(lockinuse).error(); } byte buffer[65536]; memset(buffer, 0, sizeof(buffer)); |