mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 23:47:45 +00:00
Kernel: Handle OOM when allocating Packet KBuffers
This commit is contained in:
parent
8c4785bd10
commit
720a686a76
6 changed files with 47 additions and 38 deletions
|
@ -28,13 +28,15 @@ class NetworkAdapter;
|
|||
using NetworkByteBuffer = AK::Detail::ByteBuffer<1500>;
|
||||
|
||||
struct PacketWithTimestamp : public RefCounted<PacketWithTimestamp> {
|
||||
PacketWithTimestamp(KBuffer buffer, Time timestamp)
|
||||
PacketWithTimestamp(NonnullOwnPtr<KBuffer> buffer, Time timestamp)
|
||||
: buffer(move(buffer))
|
||||
, timestamp(timestamp)
|
||||
{
|
||||
}
|
||||
|
||||
KBuffer buffer;
|
||||
ReadonlyBytes bytes() { return { buffer->data(), buffer->size() }; };
|
||||
|
||||
NonnullOwnPtr<KBuffer> buffer;
|
||||
Time timestamp;
|
||||
IntrusiveListNode<PacketWithTimestamp, RefPtr<PacketWithTimestamp>> packet_node;
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue