mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-04 07:09:47 +00:00
Kernel: Make KBuffer a value-type wrapper around a KBufferImpl
A KBuffer always contains a valid KBufferImpl. If you need a "null" state buffer, use Optional<KBuffer>. This makes KBuffer very easy to work with and pass around, just like ByteBuffer before it.
This commit is contained in:
parent
52cfe9ebae
commit
605975adb5
Notes:
sideshowbarker
2024-07-19 12:52:53 +09:00
Author: https://github.com/awesomekling
Commit: 605975adb5
6 changed files with 50 additions and 22 deletions
|
@ -84,7 +84,7 @@ void NetworkAdapter::did_receive(const u8* data, int length)
|
|||
m_packet_queue.append(KBuffer::copy(data, length));
|
||||
}
|
||||
|
||||
RefPtr<KBuffer> NetworkAdapter::dequeue_packet()
|
||||
Optional<KBuffer> NetworkAdapter::dequeue_packet()
|
||||
{
|
||||
InterruptDisabler disabler;
|
||||
if (m_packet_queue.is_empty())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue