Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/windirstat/llfio.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNiall Douglas (s [underscore] sourceforge {at} nedprod [dot] com) <spamtrap@nedprod.com>2018-09-02 20:40:15 +0300
committerNiall Douglas (s [underscore] sourceforge {at} nedprod [dot] com) <spamtrap@nedprod.com>2018-09-02 20:40:15 +0300
commitc973446711c5005c5970ae3b51747a8d2c6aaf2f (patch)
treebea9f0103b19cf27a52ba3f9b86eabfbbf8890f2 /include/llfio/v2.0/utils.hpp
parentf95f2c8777ea373cf733fe2a21dae21789114bc0 (diff)
Fixed bad edit in trivial vector which was causing test failure.
Diffstat (limited to 'include/llfio/v2.0/utils.hpp')
-rw-r--r--include/llfio/v2.0/utils.hpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/include/llfio/v2.0/utils.hpp b/include/llfio/v2.0/utils.hpp
index 5523670f..b5e17ec0 100644
--- a/include/llfio/v2.0/utils.hpp
+++ b/include/llfio/v2.0/utils.hpp
@@ -50,6 +50,7 @@ namespace utils
*/
template <class T> inline T round_down_to_page_size(T i, size_t pagesize) noexcept
{
+ assert(pagesize > 0);
i = (T)(LLFIO_V2_NAMESPACE::detail::unsigned_integer_cast<uintptr_t>(i) & ~(pagesize - 1)); // NOLINT
return i;
}
@@ -57,6 +58,7 @@ namespace utils
*/
template <class T> inline T round_up_to_page_size(T i, size_t pagesize) noexcept
{
+ assert(pagesize > 0);
i = (T)((LLFIO_V2_NAMESPACE::detail::unsigned_integer_cast<uintptr_t>(i) + pagesize - 1) & ~(pagesize - 1)); // NOLINT
return i;
}
@@ -65,6 +67,7 @@ namespace utils
*/
template <class T> inline T round_to_page_size(T i, size_t pagesize) noexcept
{
+ assert(pagesize > 0);
i = {reinterpret_cast<byte *>((LLFIO_V2_NAMESPACE::detail::unsigned_integer_cast<uintptr_t>(i.data())) & ~(pagesize - 1)), (i.size() + pagesize - 1) & ~(pagesize - 1)};
return i;
}