mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-10-25 18:34:14 +00:00
LibJS+LibWeb: Use GC::Weak instead of AK::WeakPtr for GC-allocated types
This makes some common types like JS::Object smaller (by 8 bytes) and yields a minor speed improvement on many benchmarks.
This commit is contained in:
parent
25a5ed94d6
commit
dfa796a4e4
Notes:
github-actions[bot]
2025-10-17 15:25:08 +00:00
Author: https://github.com/awesomekling
Commit: dfa796a4e4
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/6496
36 changed files with 111 additions and 115 deletions
|
|
@ -31,10 +31,10 @@ GC_DEFINE_ALLOCATOR(HTMLTextAreaElement);
|
|||
|
||||
HTMLTextAreaElement::HTMLTextAreaElement(DOM::Document& document, DOM::QualifiedName qualified_name)
|
||||
: HTMLElement(document, move(qualified_name))
|
||||
, m_input_event_timer(Core::Timer::create_single_shot(0, [weak_this = make_weak_ptr()]() {
|
||||
, m_input_event_timer(Core::Timer::create_single_shot(0, [weak_this = GC::Weak<HTMLTextAreaElement> { *this }]() {
|
||||
if (!weak_this)
|
||||
return;
|
||||
static_cast<HTMLTextAreaElement*>(weak_this.ptr())->queue_firing_input_event();
|
||||
weak_this->queue_firing_input_event();
|
||||
}))
|
||||
{
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue