From 24e1e17a8ae3f2b2962b702d383abd19b57c7b05 Mon Sep 17 00:00:00 2001 From: bunnei Date: Mon, 8 Feb 2021 18:01:40 -0800 Subject: core: memory: Add templated GetPointer methods. --- src/core/memory.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/core/memory.h') diff --git a/src/core/memory.h b/src/core/memory.h index 705ebb23d..6d34fcfe2 100644 --- a/src/core/memory.h +++ b/src/core/memory.h @@ -116,6 +116,11 @@ public: */ u8* GetPointer(VAddr vaddr); + template + T* GetPointer(VAddr vaddr) { + return reinterpret_cast(GetPointer(vaddr)); + } + /** * Gets a pointer to the given address. * @@ -126,6 +131,11 @@ public: */ const u8* GetPointer(VAddr vaddr) const; + template + const T* GetPointer(VAddr vaddr) const { + return reinterpret_cast(GetPointer(vaddr)); + } + /** * Reads an 8-bit unsigned value from the current process' address space * at the given virtual address. -- cgit v1.2.3