~satchmo/libvmm

63790100ad8a31bf9b3bac60972dae60a4e909ea — Jason Phan 4 months ago 7cbc9db
memory: Address::align_up -> Address::align
3 files changed, 3 insertions(+), 5 deletions(-)

M vmm/memory/detail/address.hpp
M vmm/memory/detail/guest.cpp
M vmm/memory/detail/guest.hpp
M vmm/memory/detail/address.hpp => vmm/memory/detail/address.hpp +1 -1
@@ 41,7 41,7 @@ class Address
        virtual auto operator-(const Concrete&) const noexcept -> Concrete = 0;

        // Aligns the address to a power of 2.
        virtual auto align_up(const Size) noexcept -> void = 0;
        virtual auto align(const Size) noexcept -> void = 0;
};

//template<typename Derived>

M vmm/memory/detail/guest.cpp => vmm/memory/detail/guest.cpp +1 -3
@@ 1,7 1,5 @@
#include "vmm/memory/detail/guest.hpp"
#include "vmm/types/detail/exceptions.hpp"
#include <stdexcept>
#include <string>

namespace vmm::memory::detail {



@@ 40,7 38,7 @@ auto GuestAddress::operator-(const_reference addr) const noexcept -> value_type
    return *this - addr.data();
}

auto GuestAddress::align_up(const size_type alignment) noexcept -> void
auto GuestAddress::align(const size_type alignment) noexcept -> void
{
    const auto mask = alignment - 1;
    m_addr = (*this + mask) & !mask;

M vmm/memory/detail/guest.hpp => vmm/memory/detail/guest.hpp +1 -1
@@ 56,7 56,7 @@ class GuestAddress : public Address<GuestAddress, uint64_t>
        auto operator-(const_reference addr) const noexcept -> value_type override;

        // Aligns the address to a power of 2.
        auto align_up(const size_type alignment) noexcept -> void override;
        auto align(const size_type alignment) noexcept -> void override;
};

}  // vmm::memory::detail