diff options
author | Niall Douglas (s [underscore] sourceforge {at} nedprod [dot] com) <spamtrap@nedprod.com> | 2018-07-24 22:29:21 +0300 |
---|---|---|
committer | Niall Douglas (s [underscore] sourceforge {at} nedprod [dot] com) <spamtrap@nedprod.com> | 2018-07-24 22:29:21 +0300 |
commit | 964d174c1c44d4810789b198bbf07271cebbe8c8 (patch) | |
tree | dc3d0ebb672e919caa2f9d2b8fb5654d230ae604 /include/llfio/v2.0/map_handle.hpp | |
parent | 084b3eb8aaae639e9a63e97245386fd78b8d8413 (diff) |
i/o buffers now work as if they were span<byte>.
Implemented many of the missing functions in path_view.
Implemented symlink_handle for Windows.
Diffstat (limited to 'include/llfio/v2.0/map_handle.hpp')
-rw-r--r-- | include/llfio/v2.0/map_handle.hpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/include/llfio/v2.0/map_handle.hpp b/include/llfio/v2.0/map_handle.hpp index d3a8c2df..60deb440 100644 --- a/include/llfio/v2.0/map_handle.hpp +++ b/include/llfio/v2.0/map_handle.hpp @@ -362,15 +362,15 @@ public: LLFIO_MAKE_FREE_FUNCTION static const_buffer_type barrier(const_buffer_type req, bool evict = false) noexcept { - const_buffer_type ret{(const_buffer_type::pointer)(((uintptr_t) req.data) & 31), 0}; - ret.len = req.data + req.len - ret.data; - for(const_buffer_type::pointer addr = ret.data; addr < ret.data + ret.len; addr += 32) + auto *tp = (const_buffer_type::pointer)(((uintptr_t) req.data()) & 31); + const_buffer_type ret{tp, (size_t)(req.data() + req.size() - tp)}; + for(const_buffer_type::pointer addr = ret.data(); addr < ret.data() + ret.size(); addr += 32) { // Slightly UB ... auto *p = reinterpret_cast<const persistent<byte> *>(addr); if(memory_flush_none == p->flush(evict ? memory_flush_evict : memory_flush_retain)) { - req.len = 0; + ret = {tp, 0}; break; } } |