TArray
UE源码解析-TArray
这篇文章我们来分析UE里的变长数组的实现,对应模块为 Core 。
在 ContainersFwd.h 中罗列了很多容器模板的声明,里面包含 TArray : 1
template<typename T, typename Allocator = FDefaultAllocator> class TArray;
Allocator
默认的分配器是 TSizedHeapAllocator ,在 ContainerAllocationPolicies.h 中声明: 1
2template <int IndexSize> class TSizedDefaultAllocator : public TSizedHeapAllocator<IndexSize> { public: typedef TSizedHeapAllocator<IndexSize> Typedef; };
using FDefaultAllocator = TSizedDefaultAllocator<32>;
All articles on this blog are licensed under CC BY-NC-SA 4.0 unless otherwise stated.
