kernel: Replace usage of boost::intrusive_ptr with std::shared_ptr for kernel objects. (#3154)

* kernel: Replace usage of boost::intrusive_ptr with std::shared_ptr for kernel objects.

- See https://github.com/citra-emu/citra/pull/4710 for details.
This commit is contained in:
bunnei
2019-11-24 20:15:51 -05:00
committed by GitHub
parent b03242067d
commit 9046d4a548
74 changed files with 377 additions and 378 deletions

View File

@ -44,7 +44,7 @@ ResultCode HandleTable::SetSize(s32 handle_table_size) {
return RESULT_SUCCESS;
}
ResultVal<Handle> HandleTable::Create(SharedPtr<Object> obj) {
ResultVal<Handle> HandleTable::Create(std::shared_ptr<Object> obj) {
DEBUG_ASSERT(obj != nullptr);
const u16 slot = next_free_slot;
@ -70,7 +70,7 @@ ResultVal<Handle> HandleTable::Create(SharedPtr<Object> obj) {
}
ResultVal<Handle> HandleTable::Duplicate(Handle handle) {
SharedPtr<Object> object = GetGeneric(handle);
std::shared_ptr<Object> object = GetGeneric(handle);
if (object == nullptr) {
LOG_ERROR(Kernel, "Tried to duplicate invalid handle: {:08X}", handle);
return ERR_INVALID_HANDLE;
@ -99,11 +99,11 @@ bool HandleTable::IsValid(Handle handle) const {
return slot < table_size && objects[slot] != nullptr && generations[slot] == generation;
}
SharedPtr<Object> HandleTable::GetGeneric(Handle handle) const {
std::shared_ptr<Object> HandleTable::GetGeneric(Handle handle) const {
if (handle == CurrentThread) {
return GetCurrentThread();
return SharedFrom(GetCurrentThread());
} else if (handle == CurrentProcess) {
return Core::System::GetInstance().CurrentProcess();
return SharedFrom(Core::System::GetInstance().CurrentProcess());
}
if (!IsValid(handle)) {