mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-10-20 15:09:42 +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
|
@ -126,7 +126,7 @@ GC::Ptr<HTML::SharedResourceRequest> fetch_an_external_image_for_a_stylesheet(St
|
|||
|
||||
auto shared_resource_request = HTML::SharedResourceRequest::get_or_create(realm, document->page(), request->url());
|
||||
shared_resource_request->add_callbacks(
|
||||
[document, weak_document = document->make_weak_ptr<DOM::Document>()] {
|
||||
[document, weak_document = GC::Weak { document }] {
|
||||
if (!weak_document)
|
||||
return;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue