1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 23:07:35 +00:00

IPv4: Use KBuffer instead of ByteBuffer for socket receive queues

This drastically reduces the pressure on the kernel heap when receiving
data from IPv4 sockets.
This commit is contained in:
Andreas Kling 2019-08-04 21:07:50 +02:00
parent 609495882f
commit 72798519cb
7 changed files with 18 additions and 19 deletions

View file

@ -16,7 +16,7 @@ private:
virtual const char* class_name() const override { return "UDPSocket"; }
static Lockable<HashMap<u16, UDPSocket*>>& sockets_by_port();
virtual int protocol_receive(const ByteBuffer&, void* buffer, size_t buffer_size, int flags) override;
virtual int protocol_receive(const KBuffer&, void* buffer, size_t buffer_size, int flags) override;
virtual int protocol_send(const void*, int) override;
virtual KResult protocol_connect(FileDescription&, ShouldBlock) override { return KSuccess; }
virtual int protocol_allocate_local_port() override;