mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-05-01 20:17:13 +02:00
AK: Turn ByteBuffer into a value type
Previously ByteBuffer would internally hold a RefPtr to the byte buffer and would behave like a reference type, i.e. copying a ByteBuffer would not create a duplicate byte buffer, but rather two objects which refer to the same internal buffer. This also changes ByteBuffer so that it has some internal capacity much like the Vector<T> type. Unlike Vector<T> however a byte buffer's data may be uninitialized. With this commit ByteBuffer makes use of the kmalloc_good_size() API to pick an optimal allocation size for its internal buffer.
This commit is contained in:
committed by
Andreas Kling
parent
f0fa51773a
commit
fcaf98361f
Notes:
sideshowbarker
2024-07-18 18:01:58 +09:00
Author: https://github.com/gunnarbeutner Commit: https://github.com/SerenityOS/serenity/commit/fcaf98361f6 Pull-request: https://github.com/SerenityOS/serenity/pull/7151 Reviewed-by: https://github.com/alimpfard
@@ -169,7 +169,7 @@ void HexEditorWidget::initialize_menubar(GUI::Menubar& menubar)
|
||||
}));
|
||||
edit_menu.add_separator();
|
||||
edit_menu.add_action(GUI::Action::create("&Find", { Mod_Ctrl, Key_F }, Gfx::Bitmap::load_from_file("/res/icons/16x16/find.png"), [&](const GUI::Action&) {
|
||||
auto old_buffer = m_search_buffer.isolated_copy();
|
||||
auto old_buffer = m_search_buffer;
|
||||
if (FindDialog::show(window(), m_search_text, m_search_buffer) == GUI::InputBox::ExecOK) {
|
||||
|
||||
bool same_buffers = false;
|
||||
|
||||
Reference in New Issue
Block a user