mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 18:27:39 +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:
parent
8ea029405f
commit
746b310061
3 changed files with 15 additions and 7 deletions
|
@ -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>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue