Skip to content
This repository was archived by the owner on Oct 29, 2024. It is now read-only.

Remove resource limit checks for now. #89

Merged
merged 1 commit into from
Apr 22, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/core/hle/kernel/resource_limit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,10 @@ bool ResourceLimit::Reserve(ResourceLimitType type, s32 amount) {
const auto index = static_cast<std::size_t>(type);
const s32 limit = m_limit_values[index];
const s32 new_value = m_current_values[index] + amount;
// TODO(PabloMK7): Fix all resource limit bugs and return an error, instead of ignoring it.
if (new_value > limit) {
LOG_ERROR(Kernel, "New value {} exceeds limit {} for resource type {}", new_value, limit,
type);
return false;
}
m_current_values[index] = new_value;
return true;
Expand All @@ -57,10 +57,10 @@ bool ResourceLimit::Reserve(ResourceLimitType type, s32 amount) {
bool ResourceLimit::Release(ResourceLimitType type, s32 amount) {
const auto index = static_cast<std::size_t>(type);
const s32 value = m_current_values[index];
// TODO(PabloMK7): Fix all resource limit bugs and return an error, instead of ignoring it.
if (amount > value) {
LOG_ERROR(Kernel, "Amount {} exceeds current value {} for resource type {}", amount, value,
type);
return false;
}
m_current_values[index] = value - amount;
return true;
Expand Down