mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-03 08:52:54 +00:00
Kernel: Avoid allocations when handling network packets
This commit is contained in:
parent
53d0150827
commit
006f11f23d
Notes:
sideshowbarker
2024-07-18 18:01:33 +09:00
Author: https://github.com/gunnarbeutner
Commit: 006f11f23d
Pull-request: https://github.com/SerenityOS/serenity/pull/7151
Reviewed-by: https://github.com/alimpfard
5 changed files with 8 additions and 6 deletions
|
@ -406,7 +406,7 @@ void NE2000NetworkAdapter::receive()
|
|||
dbgln_if(NE2000_DEBUG, "NE2000NetworkAdapter: Packet received {} length={}", (packet_ok ? "intact" : "damaged"), header.length);
|
||||
|
||||
if (packet_ok) {
|
||||
auto packet = ByteBuffer::create_uninitialized(sizeof(received_packet_header) + header.length);
|
||||
auto packet = NetworkByteBuffer::create_uninitialized(sizeof(received_packet_header) + header.length);
|
||||
int bytes_left = packet.size();
|
||||
int current_offset = 0;
|
||||
int ring_offset = header_address;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue