diff options
author | bunnei <bunneidev@gmail.com> | 2022-01-19 06:20:42 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-01-19 06:20:42 +0100 |
commit | b5e83bcc7bb8d079aad8c9831e29a3597817b9d5 (patch) | |
tree | 270b47c58f3e704fa20cd7c813f0a1a0a53cd766 /src/core/hle/kernel/k_memory_manager.h | |
parent | Merge pull request #7715 from gidoly/patch-4 (diff) | |
parent | hle: kernel: k_memory_manager: Clear pages on allocation & free. (diff) | |
download | yuzu-b5e83bcc7bb8d079aad8c9831e29a3597817b9d5.tar yuzu-b5e83bcc7bb8d079aad8c9831e29a3597817b9d5.tar.gz yuzu-b5e83bcc7bb8d079aad8c9831e29a3597817b9d5.tar.bz2 yuzu-b5e83bcc7bb8d079aad8c9831e29a3597817b9d5.tar.lz yuzu-b5e83bcc7bb8d079aad8c9831e29a3597817b9d5.tar.xz yuzu-b5e83bcc7bb8d079aad8c9831e29a3597817b9d5.tar.zst yuzu-b5e83bcc7bb8d079aad8c9831e29a3597817b9d5.zip |
Diffstat (limited to '')
-rw-r--r-- | src/core/hle/kernel/k_memory_manager.h | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/src/core/hle/kernel/k_memory_manager.h b/src/core/hle/kernel/k_memory_manager.h index 39badc5f1..abd6c8ace 100644 --- a/src/core/hle/kernel/k_memory_manager.h +++ b/src/core/hle/kernel/k_memory_manager.h @@ -12,6 +12,10 @@ #include "core/hle/kernel/k_page_heap.h" #include "core/hle/result.h" +namespace Core { +class System; +} + namespace Kernel { class KPageLinkedList; @@ -42,7 +46,7 @@ public: Mask = (0xF << Shift), }; - KMemoryManager() = default; + explicit KMemoryManager(Core::System& system_); constexpr std::size_t GetSize(Pool pool) const { return managers[static_cast<std::size_t>(pool)].GetSize(); @@ -51,10 +55,10 @@ public: void InitializeManager(Pool pool, u64 start_address, u64 end_address); VAddr AllocateAndOpenContinuous(size_t num_pages, size_t align_pages, u32 option); - ResultCode Allocate(KPageLinkedList& page_list, std::size_t num_pages, Pool pool, - Direction dir = Direction::FromFront); - ResultCode Free(KPageLinkedList& page_list, std::size_t num_pages, Pool pool, - Direction dir = Direction::FromFront); + ResultCode Allocate(KPageLinkedList& page_list, std::size_t num_pages, Pool pool, Direction dir, + u32 heap_fill_value = 0); + ResultCode Free(KPageLinkedList& page_list, std::size_t num_pages, Pool pool, Direction dir, + u32 heap_fill_value = 0); static constexpr std::size_t MaxManagerCount = 10; @@ -129,6 +133,7 @@ private: }; private: + Core::System& system; std::array<std::mutex, static_cast<std::size_t>(Pool::Count)> pool_locks; std::array<Impl, MaxManagerCount> managers; }; |