diff options
author | Niall Douglas (s [underscore] sourceforge {at} nedprod [dot] com) <spamtrap@nedprod.com> | 2018-08-14 22:05:04 +0300 |
---|---|---|
committer | Niall Douglas (s [underscore] sourceforge {at} nedprod [dot] com) <spamtrap@nedprod.com> | 2018-08-14 22:05:04 +0300 |
commit | 83b7ad9bfda9af36414d8d6acac454288cb90a3a (patch) | |
tree | 6257bfa05626926de3c45a32bfad48cc6c068157 /include/llfio/v2.0/mapped.hpp | |
parent | e2434aa9d42d50651ed9685b5125f58262366081 (diff) |
symlink_handle is finished and fully working on POSIX.
Also fixed a number of vptr slicing bugs across the handle implementations, mainly caused by missing operator=() implementations.
Fixed path_handle::clone() not working on POSIX.
Diffstat (limited to 'include/llfio/v2.0/mapped.hpp')
-rw-r--r-- | include/llfio/v2.0/mapped.hpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/include/llfio/v2.0/mapped.hpp b/include/llfio/v2.0/mapped.hpp index e0385254..e723ca75 100644 --- a/include/llfio/v2.0/mapped.hpp +++ b/include/llfio/v2.0/mapped.hpp @@ -81,13 +81,15 @@ public: //! Returns a reference to the internal map handle const map_handle &map() const noexcept { return _maph; } - /*! Create a view of new memory. + /*! Create a view of newly allocated unused memory, creating new memory if insufficient unused memory is available. + Note that the memory mapped by this call may contain non-zero bits (recycled memory) unless `zeroed` is true. \param length The number of items to map. + \param zeroed Whether to ensure that the viewed memory returned is all bits zero or not. \param _flag The flags to pass to `map_handle::map()`. */ - explicit mapped(size_type length, section_handle::flag _flag = section_handle::flag::readwrite) - : _maph(map_handle::map(length * sizeof(T), _flag).value()) + explicit mapped(size_type length, bool zeroed = false, section_handle::flag _flag = section_handle::flag::readwrite) + : _maph(map_handle::map(length * sizeof(T), zeroed, _flag).value()) { byte *addr = _maph.address(); static_cast<span<T> &>(*this) = span<T>(reinterpret_cast<T *>(addr), length); // NOLINT |