diff options
Diffstat (limited to 'src/osd/modules/lib/osdlib.h')
-rw-r--r-- | src/osd/modules/lib/osdlib.h | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/src/osd/modules/lib/osdlib.h b/src/osd/modules/lib/osdlib.h index c84901002ad..72815d687db 100644 --- a/src/osd/modules/lib/osdlib.h +++ b/src/osd/modules/lib/osdlib.h @@ -78,7 +78,7 @@ std::error_condition osd_set_clipboard_text(std::string_view text) noexcept; namespace osd { -bool invalidate_instruction_cache(void const *start, std::size_t size); +bool invalidate_instruction_cache(void const *start, std::size_t size) noexcept; class virtual_memory_allocation @@ -98,12 +98,12 @@ public: virtual_memory_allocation(virtual_memory_allocation const &) = delete; virtual_memory_allocation &operator=(virtual_memory_allocation const &) = delete; - virtual_memory_allocation() { } - virtual_memory_allocation(std::initializer_list<std::size_t> blocks, unsigned intent) + virtual_memory_allocation() noexcept { } + virtual_memory_allocation(std::initializer_list<std::size_t> blocks, unsigned intent) noexcept { m_memory = do_alloc(blocks, intent, m_size, m_page_size); } - virtual_memory_allocation(virtual_memory_allocation &&that) : m_memory(that.m_memory), m_size(that.m_size), m_page_size(that.m_page_size) + virtual_memory_allocation(virtual_memory_allocation &&that) noexcept : m_memory(that.m_memory), m_size(that.m_size), m_page_size(that.m_page_size) { that.m_memory = nullptr; that.m_size = that.m_page_size = 0U; @@ -114,12 +114,12 @@ public: do_free(m_memory, m_size); } - explicit operator bool() const { return bool(m_memory); } - void *get() { return m_memory; } - std::size_t size() const { return m_size; } - std::size_t page_size() const { return m_page_size; } + explicit operator bool() const noexcept { return bool(m_memory); } + void *get() noexcept { return m_memory; } + std::size_t size() const noexcept { return m_size; } + std::size_t page_size() const noexcept { return m_page_size; } - bool set_access(std::size_t start, std::size_t size, unsigned access) + bool set_access(std::size_t start, std::size_t size, unsigned access) noexcept { if ((start % m_page_size) || (size % m_page_size) || (start > m_size) || ((m_size - start) < size)) return false; @@ -127,7 +127,7 @@ public: return do_set_access(reinterpret_cast<std::uint8_t *>(m_memory) + start, size, access); } - virtual_memory_allocation &operator=(std::nullptr_t) + virtual_memory_allocation &operator=(std::nullptr_t) noexcept { if (m_memory) do_free(m_memory, m_size); @@ -136,7 +136,7 @@ public: return *this; } - virtual_memory_allocation &operator=(virtual_memory_allocation &&that) + virtual_memory_allocation &operator=(virtual_memory_allocation &&that) noexcept { if (&that != this) { @@ -152,9 +152,9 @@ public: } private: - static void *do_alloc(std::initializer_list<std::size_t> blocks, unsigned intent, std::size_t &size, std::size_t &page_size); - static void do_free(void *start, std::size_t size); - static bool do_set_access(void *start, std::size_t size, unsigned access); + static void *do_alloc(std::initializer_list<std::size_t> blocks, unsigned intent, std::size_t &size, std::size_t &page_size) noexcept; + static void do_free(void *start, std::size_t size) noexcept; + static bool do_set_access(void *start, std::size_t size, unsigned access) noexcept; void *m_memory = nullptr; std::size_t m_size = 0U, m_page_size = 0U; |