From 18fbf199ec7cace12ece46c9ed3c7f655561bf26 Mon Sep 17 00:00:00 2001 From: mandreyel Date: Tue, 12 Mar 2019 22:58:51 +0100 Subject: [PATCH] Fix minor errors in internal docs --- include/mio/detail/mmap.ipp | 7 ++++--- include/mio/mmap.hpp | 16 +++++++++------- 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/include/mio/detail/mmap.ipp b/include/mio/detail/mmap.ipp index 0b89178..361db30 100644 --- a/include/mio/detail/mmap.ipp +++ b/include/mio/detail/mmap.ipp @@ -400,9 +400,10 @@ void basic_mmap::unmap() if(data_) { ::munmap(const_cast(get_mapping_start()), mapped_length_); } #endif - // If file_handle_ was obtained by our opening it (when map is called with a path, - // rather than an existing file handle), we need to close it, otherwise it must not - // be closed as it may still be used outside this instance. + // If `file_handle_` was obtained by our opening it (when map is called with + // a path, rather than an existing file handle), we need to close it, + // otherwise it must not be closed as it may still be used outside this + // instance. if(is_handle_internal_) { #ifdef _WIN32 diff --git a/include/mio/mmap.hpp b/include/mio/mmap.hpp index 9de9d93..ddb95b2 100644 --- a/include/mio/mmap.hpp +++ b/include/mio/mmap.hpp @@ -76,15 +76,17 @@ private: // Points to the first requested byte, and not to the actual start of the mapping. pointer data_ = nullptr; - // Length, in bytes, requested by user, which may not be the length of the full - // mapping, and the entire length of the full mapping. + // Length--in bytes--requested by user (which may not be the length of the + // full mapping) and the length of the full mapping. size_type length_ = 0; size_type mapped_length_ = 0; - // Letting user map a file using both an existing file handle and a path introcudes - // On POSIX, we only need a file handle to create a mapping, while on Windows - // systems the file handle is necessary to retrieve a file mapping handle, but any - // subsequent operations on the mapped region must be done through the latter. + // Letting user map a file using both an existing file handle and a path + // introcudes some complexity (see `is_handle_internal_`). + // On POSIX, we only need a file handle to create a mapping, while on + // Windows systems the file handle is necessary to retrieve a file mapping + // handle, but any subsequent operations on the mapped region must be done + // through the latter. handle_type file_handle_ = INVALID_HANDLE_VALUE; #ifdef _WIN32 handle_type file_mapping_handle_ = INVALID_HANDLE_VALUE; @@ -94,7 +96,7 @@ private: // introcudes some complexity in that we must not close the file handle if // user provided it, but we must close it if we obtained it using the // provided path. For this reason, this flag is used to determine when to - // close file_handle_. + // close `file_handle_`. bool is_handle_internal_; public: