mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-10-19 15:43:20 +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
|
@ -38,8 +38,8 @@ public:
|
|||
void disconnect();
|
||||
Vector<GC::Root<MutationRecord>> take_records();
|
||||
|
||||
Vector<WeakPtr<Node>>& node_list() { return m_node_list; }
|
||||
Vector<WeakPtr<Node>> const& node_list() const { return m_node_list; }
|
||||
Vector<GC::Weak<Node>>& node_list() { return m_node_list; }
|
||||
Vector<GC::Weak<Node>> const& node_list() const { return m_node_list; }
|
||||
|
||||
WebIDL::CallbackType& callback() { return *m_callback; }
|
||||
|
||||
|
@ -61,7 +61,7 @@ private:
|
|||
// https://dom.spec.whatwg.org/#mutationobserver-node-list
|
||||
// NOTE: These are weak, per https://dom.spec.whatwg.org/#garbage-collection
|
||||
// Registered observers in a node’s registered observer list have a weak reference to the node.
|
||||
Vector<WeakPtr<Node>> m_node_list;
|
||||
Vector<GC::Weak<Node>> m_node_list;
|
||||
|
||||
// https://dom.spec.whatwg.org/#concept-mo-queue
|
||||
Vector<GC::Ref<MutationRecord>> m_record_queue;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue