From c82fd7320a83daec780bb9f7c11239e269410c91 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karel=20Ko=C4=8D=C3=AD?= Date: Thu, 25 Jan 2018 17:10:59 +0100 Subject: Add focus function to memory view --- qtmips_machine/memory.cpp | 10 ++++++++++ qtmips_machine/memory.h | 4 ++++ 2 files changed, 14 insertions(+) (limited to 'qtmips_machine') diff --git a/qtmips_machine/memory.cpp b/qtmips_machine/memory.cpp index eec9f8c..07c8e3c 100644 --- a/qtmips_machine/memory.cpp +++ b/qtmips_machine/memory.cpp @@ -254,6 +254,16 @@ const union machine::MemoryTree *Memory::get_memorytree_root() const { return this->mt_root; } +std::uint32_t Memory::next_allocated(std::uint32_t addr) const { + // TODO + return addr; +} + +std::uint32_t Memory::prev_allocated(std::uint32_t addr) const { + // TODO + return addr; +} + union machine::MemoryTree *Memory::allocate_section_tree() { union MemoryTree *mt = new union MemoryTree[MEMORY_TREE_LEN]; for (size_t i = 0; i < MEMORY_TREE_LEN; i++) diff --git a/qtmips_machine/memory.h b/qtmips_machine/memory.h index d1fa2e7..525ca56 100644 --- a/qtmips_machine/memory.h +++ b/qtmips_machine/memory.h @@ -87,6 +87,10 @@ public: const union MemoryTree *get_memorytree_root() const; + // These functions locate next start or end of next allocated tree leaf + std::uint32_t next_allocated(std::uint32_t) const; + std::uint32_t prev_allocated(std::uint32_t) const; + private: union MemoryTree *mt_root; static union MemoryTree *allocate_section_tree(); -- cgit v1.2.3