mirror of
				https://github.com/RGBCube/serenity
				synced 2025-10-30 02:22:07 +00:00 
			
		
		
		
	 34160743dc
			
		
	
	
		34160743dc
		
	
	
	
	
		
			
			For every IPC message sent, we currently prepend the message size to the IPC message buffer. This incurs the cost of copying the entire message to its newly allocated position. Instead, reserve the bytes for the size at the front of the buffer upon creation. Prevent dangerous access to the buffer with specific public methods.
		
			
				
	
	
		
			26 lines
		
	
	
	
		
			374 B
		
	
	
	
		
			C++
		
	
	
	
	
	
			
		
		
	
	
			26 lines
		
	
	
	
		
			374 B
		
	
	
	
		
			C++
		
	
	
	
	
	
| /*
 | |
|  * Copyright (c) 2020, Andreas Kling <kling@serenityos.org>
 | |
|  *
 | |
|  * SPDX-License-Identifier: BSD-2-Clause
 | |
|  */
 | |
| 
 | |
| #pragma once
 | |
| 
 | |
| #include <AK/Error.h>
 | |
| 
 | |
| namespace IPC {
 | |
| 
 | |
| class Decoder;
 | |
| class Encoder;
 | |
| class Message;
 | |
| class MessageBuffer;
 | |
| class File;
 | |
| class Stub;
 | |
| 
 | |
| template<typename T>
 | |
| ErrorOr<void> encode(Encoder&, T const&);
 | |
| 
 | |
| template<typename T>
 | |
| ErrorOr<T> decode(Decoder&);
 | |
| 
 | |
| }
 |