diff options
| author | 2018-11-21 18:30:58 -0500 | |
|---|---|---|
| committer | 2018-11-21 18:31:01 -0500 | |
| commit | 0e35f1bb18b71fcb936b3a00e6bda0fa82a0b59c (patch) | |
| tree | 53941cfab7535f6fa7df24ee777d086ce4f495ec /src | |
| parent | kernel/handle_table: Restrict handle table size to 1024 entries (diff) | |
| download | yuzu-0e35f1bb18b71fcb936b3a00e6bda0fa82a0b59c.tar.gz yuzu-0e35f1bb18b71fcb936b3a00e6bda0fa82a0b59c.tar.xz yuzu-0e35f1bb18b71fcb936b3a00e6bda0fa82a0b59c.zip | |
kernel/handle_table: Move private static functions into the cpp file
These don't depend on class state, and are effectively implementation
details, so they can go into the cpp file .
Diffstat (limited to 'src')
| -rw-r--r-- | src/core/hle/kernel/handle_table.cpp | 9 | ||||
| -rw-r--r-- | src/core/hle/kernel/handle_table.h | 7 |
2 files changed, 9 insertions, 7 deletions
diff --git a/src/core/hle/kernel/handle_table.cpp b/src/core/hle/kernel/handle_table.cpp index 9f2b996c4..1bf79b692 100644 --- a/src/core/hle/kernel/handle_table.cpp +++ b/src/core/hle/kernel/handle_table.cpp | |||
| @@ -12,6 +12,15 @@ | |||
| 12 | #include "core/hle/kernel/thread.h" | 12 | #include "core/hle/kernel/thread.h" |
| 13 | 13 | ||
| 14 | namespace Kernel { | 14 | namespace Kernel { |
| 15 | namespace { | ||
| 16 | constexpr u16 GetSlot(Handle handle) { | ||
| 17 | return handle >> 15; | ||
| 18 | } | ||
| 19 | |||
| 20 | constexpr u16 GetGeneration(Handle handle) { | ||
| 21 | return handle & 0x7FFF; | ||
| 22 | } | ||
| 23 | } // Anonymous namespace | ||
| 15 | 24 | ||
| 16 | HandleTable::HandleTable() { | 25 | HandleTable::HandleTable() { |
| 17 | next_generation = 1; | 26 | next_generation = 1; |
diff --git a/src/core/hle/kernel/handle_table.h b/src/core/hle/kernel/handle_table.h index ae3116afc..e3f3e3fb8 100644 --- a/src/core/hle/kernel/handle_table.h +++ b/src/core/hle/kernel/handle_table.h | |||
| @@ -93,13 +93,6 @@ private: | |||
| 93 | /// This is the maximum limit of handles allowed per process in Horizon | 93 | /// This is the maximum limit of handles allowed per process in Horizon |
| 94 | static constexpr std::size_t MAX_COUNT = 1024; | 94 | static constexpr std::size_t MAX_COUNT = 1024; |
| 95 | 95 | ||
| 96 | static u16 GetSlot(Handle handle) { | ||
| 97 | return handle >> 15; | ||
| 98 | } | ||
| 99 | static u16 GetGeneration(Handle handle) { | ||
| 100 | return handle & 0x7FFF; | ||
| 101 | } | ||
| 102 | |||
| 103 | /// Stores the Object referenced by the handle or null if the slot is empty. | 96 | /// Stores the Object referenced by the handle or null if the slot is empty. |
| 104 | std::array<SharedPtr<Object>, MAX_COUNT> objects; | 97 | std::array<SharedPtr<Object>, MAX_COUNT> objects; |
| 105 | 98 | ||