mirror of
				https://git.suyu.dev/suyu/suyu
				synced 2025-11-04 00:49:02 -06:00 
			
		
		
		
	Kernel: Allow clearing request_objects to re-use buffer space
Reduces the necessary allocation to max(in_handles, out_handles) rather than (in_handles + out_handles).
This commit is contained in:
		@@ -35,6 +35,10 @@ u32 HLERequestContext::AddOutgoingHandle(SharedPtr<Object> object) {
 | 
			
		||||
    return request_handles.size() - 1;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void HLERequestContext::ClearIncomingObjects() {
 | 
			
		||||
    request_handles.clear();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
ResultCode HLERequestContext::PopulateFromIncomingCommandBuffer(const u32_le* src_cmdbuf,
 | 
			
		||||
                                                                Process& src_process,
 | 
			
		||||
                                                                HandleTable& src_table) {
 | 
			
		||||
 
 | 
			
		||||
@@ -110,6 +110,13 @@ public:
 | 
			
		||||
     */
 | 
			
		||||
    u32 AddOutgoingHandle(SharedPtr<Object> object);
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * Discards all Objects from the context, invalidating all ids. This may be called after reading
 | 
			
		||||
     * out all incoming objects, so that the buffer memory can be re-used for outgoing handles, but
 | 
			
		||||
     * this is not required.
 | 
			
		||||
     */
 | 
			
		||||
    void ClearIncomingObjects();
 | 
			
		||||
 | 
			
		||||
private:
 | 
			
		||||
    friend class Service::ServiceFrameworkBase;
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user