1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 10:47:35 +00:00

LibJS: Use IntrusiveList for keeping track of HandleImpls

This allows us to remove a HashTable from heap and cuts down on
some of the malloc traffic when creating handles.
This commit is contained in:
Andreas Kling 2021-07-21 19:45:21 +02:00
parent 8ea029405f
commit 746b310061
3 changed files with 15 additions and 7 deletions

View file

@ -7,6 +7,7 @@
#pragma once
#include <AK/Badge.h>
#include <AK/IntrusiveList.h>
#include <AK/Noncopyable.h>
#include <AK/RefCounted.h>
#include <AK/RefPtr.h>
@ -30,6 +31,11 @@ private:
explicit HandleImpl(Cell*);
Cell* m_cell { nullptr };
IntrusiveListNode<HandleImpl> m_list_node;
public:
using List = IntrusiveList<HandleImpl, RawPtr<HandleImpl>, &HandleImpl::m_list_node>;
};
template<class T>