From 8b99fb26d919a0326390ecb2d21007edf20eb3e7 Mon Sep 17 00:00:00 2001 From: Brian Gianforcaro Date: Mon, 27 Dec 2021 16:32:38 -0800 Subject: [PATCH] Kernel: Use type alias for Kmalloc SubHeap and SlabBlock list types We've moved to this pattern for the majority of usages of IntrusiveList in the Kernel, might as well be consistent. :^) --- Kernel/Heap/kmalloc.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Kernel/Heap/kmalloc.cpp b/Kernel/Heap/kmalloc.cpp index 147f502716..1d82053781 100644 --- a/Kernel/Heap/kmalloc.cpp +++ b/Kernel/Heap/kmalloc.cpp @@ -44,6 +44,7 @@ struct KmallocSubheap { } IntrusiveListNode list_node; + using List = IntrusiveList<&KmallocSubheap::list_node>; Heap allocator; }; @@ -82,6 +83,7 @@ public: } IntrusiveListNode list_node; + using List = IntrusiveList<&KmallocSlabBlock::list_node>; private: struct FreelistEntry { @@ -138,8 +140,8 @@ public: private: size_t m_slab_size { 0 }; - IntrusiveList<&KmallocSlabBlock::list_node> m_usable_blocks; - IntrusiveList<&KmallocSlabBlock::list_node> m_full_blocks; + KmallocSlabBlock::List m_usable_blocks; + KmallocSlabBlock::List m_full_blocks; }; struct KmallocGlobalData { @@ -294,7 +296,7 @@ struct KmallocGlobalData { }; Optional expansion_data; - IntrusiveList<&KmallocSubheap::list_node> subheaps; + KmallocSubheap::List subheaps; KmallocSlabheap slabheaps[6] = { 16, 32, 64, 128, 256, 512 };