summaryrefslogtreecommitdiff
path: root/src/core/hle/kernel/kernel.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/hle/kernel/kernel.cpp')
-rw-r--r--src/core/hle/kernel/kernel.cpp20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/core/hle/kernel/kernel.cpp b/src/core/hle/kernel/kernel.cpp
index 5fd06046e..e8bf83a44 100644
--- a/src/core/hle/kernel/kernel.cpp
+++ b/src/core/hle/kernel/kernel.cpp
@@ -13,14 +13,14 @@
13namespace Kernel { 13namespace Kernel {
14 14
15Handle g_main_thread = 0; 15Handle g_main_thread = 0;
16ObjectPool g_object_pool; 16HandleTable g_handle_table;
17u64 g_program_id = 0; 17u64 g_program_id = 0;
18 18
19ObjectPool::ObjectPool() { 19HandleTable::HandleTable() {
20 next_id = INITIAL_NEXT_ID; 20 next_id = INITIAL_NEXT_ID;
21} 21}
22 22
23Handle ObjectPool::Create(Object* obj, int range_bottom, int range_top) { 23Handle HandleTable::Create(Object* obj, int range_bottom, int range_top) {
24 if (range_top > MAX_COUNT) { 24 if (range_top > MAX_COUNT) {
25 range_top = MAX_COUNT; 25 range_top = MAX_COUNT;
26 } 26 }
@@ -39,7 +39,7 @@ Handle ObjectPool::Create(Object* obj, int range_bottom, int range_top) {
39 return 0; 39 return 0;
40} 40}
41 41
42bool ObjectPool::IsValid(Handle handle) const { 42bool HandleTable::IsValid(Handle handle) const {
43 int index = handle - HANDLE_OFFSET; 43 int index = handle - HANDLE_OFFSET;
44 if (index < 0) 44 if (index < 0)
45 return false; 45 return false;
@@ -49,7 +49,7 @@ bool ObjectPool::IsValid(Handle handle) const {
49 return occupied[index]; 49 return occupied[index];
50} 50}
51 51
52void ObjectPool::Clear() { 52void HandleTable::Clear() {
53 for (int i = 0; i < MAX_COUNT; i++) { 53 for (int i = 0; i < MAX_COUNT; i++) {
54 //brutally clear everything, no validation 54 //brutally clear everything, no validation
55 if (occupied[i]) 55 if (occupied[i])
@@ -60,13 +60,13 @@ void ObjectPool::Clear() {
60 next_id = INITIAL_NEXT_ID; 60 next_id = INITIAL_NEXT_ID;
61} 61}
62 62
63Object* &ObjectPool::operator [](Handle handle) 63Object* &HandleTable::operator [](Handle handle)
64{ 64{
65 _dbg_assert_msg_(Kernel, IsValid(handle), "GRABBING UNALLOCED KERNEL OBJ"); 65 _dbg_assert_msg_(Kernel, IsValid(handle), "GRABBING UNALLOCED KERNEL OBJ");
66 return pool[handle - HANDLE_OFFSET]; 66 return pool[handle - HANDLE_OFFSET];
67} 67}
68 68
69void ObjectPool::List() { 69void HandleTable::List() {
70 for (int i = 0; i < MAX_COUNT; i++) { 70 for (int i = 0; i < MAX_COUNT; i++) {
71 if (occupied[i]) { 71 if (occupied[i]) {
72 if (pool[i]) { 72 if (pool[i]) {
@@ -77,11 +77,11 @@ void ObjectPool::List() {
77 } 77 }
78} 78}
79 79
80int ObjectPool::GetCount() const { 80int HandleTable::GetCount() const {
81 return std::count(occupied.begin(), occupied.end(), true); 81 return std::count(occupied.begin(), occupied.end(), true);
82} 82}
83 83
84Object* ObjectPool::CreateByIDType(int type) { 84Object* HandleTable::CreateByIDType(int type) {
85 LOG_ERROR(Kernel, "Unimplemented: %d.", type); 85 LOG_ERROR(Kernel, "Unimplemented: %d.", type);
86 return nullptr; 86 return nullptr;
87} 87}
@@ -95,7 +95,7 @@ void Init() {
95void Shutdown() { 95void Shutdown() {
96 Kernel::ThreadingShutdown(); 96 Kernel::ThreadingShutdown();
97 97
98 g_object_pool.Clear(); // Free all kernel objects 98 g_handle_table.Clear(); // Free all kernel objects
99} 99}
100 100
101/** 101/**