mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-10-26 01:50:08 +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
|
|
@ -8,9 +8,9 @@
|
|||
|
||||
#include <AK/Function.h>
|
||||
#include <AK/Noncopyable.h>
|
||||
#include <AK/WeakPtr.h>
|
||||
#include <LibCore/Forward.h>
|
||||
#include <LibGC/Ptr.h>
|
||||
#include <LibGC/Weak.h>
|
||||
#include <LibJS/Forward.h>
|
||||
#include <LibWeb/Export.h>
|
||||
#include <LibWeb/HTML/EventLoop/TaskQueue.h>
|
||||
|
|
@ -119,7 +119,7 @@ private:
|
|||
// https://html.spec.whatwg.org/multipage/webappapis.html#performing-a-microtask-checkpoint
|
||||
bool m_performing_a_microtask_checkpoint { false };
|
||||
|
||||
Vector<WeakPtr<DOM::Document>> m_documents;
|
||||
Vector<GC::Weak<DOM::Document>> m_documents;
|
||||
|
||||
// Used to implement step 4 of "perform a microtask checkpoint".
|
||||
// NOTE: These are weak references! ESO registers and unregisters itself from the event loop manually.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue