mirror of
				https://github.com/PabloMK7/citra.git
				synced 2025-10-30 21:30:04 +00:00 
			
		
		
		
	Remove resource limit checks for now. (#89)
This commit is contained in:
		
							parent
							
								
									b1e5485058
								
							
						
					
					
						commit
						d063f26efc
					
				
					 1 changed files with 2 additions and 2 deletions
				
			
		|  | @ -45,10 +45,10 @@ bool ResourceLimit::Reserve(ResourceLimitType type, s32 amount) { | ||||||
|     const auto index = static_cast<std::size_t>(type); |     const auto index = static_cast<std::size_t>(type); | ||||||
|     const s32 limit = m_limit_values[index]; |     const s32 limit = m_limit_values[index]; | ||||||
|     const s32 new_value = m_current_values[index] + amount; |     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) { |     if (new_value > limit) { | ||||||
|         LOG_ERROR(Kernel, "New value {} exceeds limit {} for resource type {}", new_value, limit, |         LOG_ERROR(Kernel, "New value {} exceeds limit {} for resource type {}", new_value, limit, | ||||||
|                   type); |                   type); | ||||||
|         return false; |  | ||||||
|     } |     } | ||||||
|     m_current_values[index] = new_value; |     m_current_values[index] = new_value; | ||||||
|     return true; |     return true; | ||||||
|  | @ -57,10 +57,10 @@ bool ResourceLimit::Reserve(ResourceLimitType type, s32 amount) { | ||||||
| bool ResourceLimit::Release(ResourceLimitType type, s32 amount) { | bool ResourceLimit::Release(ResourceLimitType type, s32 amount) { | ||||||
|     const auto index = static_cast<std::size_t>(type); |     const auto index = static_cast<std::size_t>(type); | ||||||
|     const s32 value = m_current_values[index]; |     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) { |     if (amount > value) { | ||||||
|         LOG_ERROR(Kernel, "Amount {} exceeds current value {} for resource type {}", amount, value, |         LOG_ERROR(Kernel, "Amount {} exceeds current value {} for resource type {}", amount, value, | ||||||
|                   type); |                   type); | ||||||
|         return false; |  | ||||||
|     } |     } | ||||||
|     m_current_values[index] = value - amount; |     m_current_values[index] = value - amount; | ||||||
|     return true; |     return true; | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue