summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2018-11-22 06:26:48 +0100
committerGitHub <noreply@github.com>2018-11-22 06:26:48 +0100
commitf926559ef40bfa34bee4dabeb84b915bdb59a893 (patch)
tree0404ede53b76110924fcfcf724564b6ed647d04b
parentMerge pull request #1753 from FernandoS27/ufbtype (diff)
parentkernel/handle_table: Move private static functions into the cpp file (diff)
downloadyuzu-f926559ef40bfa34bee4dabeb84b915bdb59a893.tar
yuzu-f926559ef40bfa34bee4dabeb84b915bdb59a893.tar.gz
yuzu-f926559ef40bfa34bee4dabeb84b915bdb59a893.tar.bz2
yuzu-f926559ef40bfa34bee4dabeb84b915bdb59a893.tar.lz
yuzu-f926559ef40bfa34bee4dabeb84b915bdb59a893.tar.xz
yuzu-f926559ef40bfa34bee4dabeb84b915bdb59a893.tar.zst
yuzu-f926559ef40bfa34bee4dabeb84b915bdb59a893.zip
-rw-r--r--src/core/hle/kernel/handle_table.cpp11
-rw-r--r--src/core/hle/kernel/handle_table.h15
2 files changed, 14 insertions, 12 deletions
diff --git a/src/core/hle/kernel/handle_table.cpp b/src/core/hle/kernel/handle_table.cpp
index 5ee5c05e3..1bf79b692 100644
--- a/src/core/hle/kernel/handle_table.cpp
+++ b/src/core/hle/kernel/handle_table.cpp
@@ -12,12 +12,23 @@
#include "core/hle/kernel/thread.h"
namespace Kernel {
+namespace {
+constexpr u16 GetSlot(Handle handle) {
+ return handle >> 15;
+}
+
+constexpr u16 GetGeneration(Handle handle) {
+ return handle & 0x7FFF;
+}
+} // Anonymous namespace
HandleTable::HandleTable() {
next_generation = 1;
Clear();
}
+HandleTable::~HandleTable() = default;
+
ResultVal<Handle> HandleTable::Create(SharedPtr<Object> obj) {
DEBUG_ASSERT(obj != nullptr);
diff --git a/src/core/hle/kernel/handle_table.h b/src/core/hle/kernel/handle_table.h
index 9e2f33e8a..e3f3e3fb8 100644
--- a/src/core/hle/kernel/handle_table.h
+++ b/src/core/hle/kernel/handle_table.h
@@ -43,6 +43,7 @@ enum KernelHandle : Handle {
class HandleTable final : NonCopyable {
public:
HandleTable();
+ ~HandleTable();
/**
* Allocates a handle for the given object.
@@ -89,18 +90,8 @@ public:
void Clear();
private:
- /**
- * This is the maximum limit of handles allowed per process in CTR-OS. It can be further
- * reduced by ExHeader values, but this is not emulated here.
- */
- static const std::size_t MAX_COUNT = 4096;
-
- static u16 GetSlot(Handle handle) {
- return handle >> 15;
- }
- static u16 GetGeneration(Handle handle) {
- return handle & 0x7FFF;
- }
+ /// This is the maximum limit of handles allowed per process in Horizon
+ static constexpr std::size_t MAX_COUNT = 1024;
/// Stores the Object referenced by the handle or null if the slot is empty.
std::array<SharedPtr<Object>, MAX_COUNT> objects;