mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-27 10:07:15 +02: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:
committed by
Andreas Kling
parent
25a5ed94d6
commit
dfa796a4e4
Notes:
github-actions[bot]
2025-10-17 15:25:08 +00:00
Author: https://github.com/awesomekling Commit: https://github.com/LadybirdBrowser/ladybird/commit/dfa796a4e45 Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/6496
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user