[Memory] BaseHeap::TranslateRelative including host address offset

This commit is contained in:
Triang3l
2019-08-15 00:31:21 +03:00
parent 0451153760
commit e862169156
2 changed files with 24 additions and 20 deletions

View File

@@ -109,6 +109,12 @@ class BaseHeap {
// (not including membase).
uint32_t host_address_offset() const { return host_address_offset_; }
template <typename T = uint8_t*>
inline T TranslateRelative(size_t relative_address) const {
return reinterpret_cast<T>(membase_ + heap_base_ + host_address_offset_ +
relative_address);
}
// Disposes and decommits all memory and clears the page table.
virtual void Dispose();