From 4675d1fddcec4899616e161e796507170a79f962 Mon Sep 17 00:00:00 2001 From: Nav Date: Sat, 16 Mar 2024 16:21:39 +0000 Subject: [PATCH] Added `size()` member function to `TargeMemoryAddressRange` --- src/Targets/TargetMemory.hpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Targets/TargetMemory.hpp b/src/Targets/TargetMemory.hpp index b9bb0d07..f49f6e4d 100644 --- a/src/Targets/TargetMemory.hpp +++ b/src/Targets/TargetMemory.hpp @@ -46,6 +46,10 @@ namespace Targets return this->startAddress < rhs.startAddress; } + TargetMemorySize size() const { + return this->endAddress - this->startAddress + 1; + } + [[nodiscard]] bool intersectsWith(const TargetMemoryAddressRange& other) const { return (other.startAddress <= this->startAddress && other.endAddress >= this->startAddress)