summaryrefslogtreecommitdiff
path: root/Libraries/LibIPC/IMessage.h
diff options
context:
space:
mode:
authorAndreas Kling <awesomekling@gmail.com>2019-12-30 02:41:45 +0100
committerAndreas Kling <awesomekling@gmail.com>2019-12-30 02:41:45 +0100
commitef658594e494d34ed6af899b3524dc3b6aeed254 (patch)
tree55f49aa34df36b1d3bae3768dad151631ffa8bd0 /Libraries/LibIPC/IMessage.h
parent00d26457c5390237f0c88a5f55ffc0c24aa6d6e8 (diff)
downloadserenity-ef658594e494d34ed6af899b3524dc3b6aeed254.zip
LibIPC: Let's start building custom message codecs for LibIPC
Instead of using ByteBuffer (which always malloc() their storage) for IPC message encoding, we now use a Vector<u8, 1024>, which means that messages smaller than 1 KB avoid heap allocation entirely.
Diffstat (limited to 'Libraries/LibIPC/IMessage.h')
-rw-r--r--Libraries/LibIPC/IMessage.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/Libraries/LibIPC/IMessage.h b/Libraries/LibIPC/IMessage.h
index a6e37bdd90..96ff01125d 100644
--- a/Libraries/LibIPC/IMessage.h
+++ b/Libraries/LibIPC/IMessage.h
@@ -1,7 +1,8 @@
#pragma once
#include <AK/String.h>
-#include <AK/ByteBuffer.h>
+
+typedef Vector<u8, 1024> IMessageBuffer;
class IMessage {
public:
@@ -10,7 +11,7 @@ public:
virtual int endpoint_magic() const = 0;
virtual int message_id() const = 0;
virtual String message_name() const = 0;
- virtual ByteBuffer encode() const = 0;
+ virtual IMessageBuffer encode() const = 0;
protected:
IMessage();