mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-05-05 22:52:22 +02:00
Kernel: Make DiskBackedFS::read_block() write to client-provided memory
Instead of having DiskBackedFS allocate a ByteBuffer, leave it to each client to provide buffer space. This is significantly faster in many cases where we can use a stack buffer and avoid heap allocation entirely.
This commit is contained in:
Notes:
sideshowbarker
2024-07-19 11:52:43 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/1fc26126676
@@ -19,8 +19,8 @@ public:
|
||||
protected:
|
||||
explicit DiskBackedFS(NonnullRefPtr<DiskDevice>&&);
|
||||
|
||||
ByteBuffer read_block(unsigned index) const;
|
||||
ByteBuffer read_blocks(unsigned index, unsigned count) const;
|
||||
bool read_block(unsigned index, u8* buffer) const;
|
||||
bool read_blocks(unsigned index, unsigned count, u8* buffer) const;
|
||||
|
||||
bool write_block(unsigned index, const ByteBuffer&);
|
||||
bool write_blocks(unsigned index, unsigned count, const ByteBuffer&);
|
||||
|
||||
Reference in New Issue
Block a user