mirror of
https://github.com/Milxnor/Project-Reboot-3.0.git
synced 2026-01-13 02:42:22 +01:00
a lottt of stuff
This commit is contained in:
29
Project Reboot 3.0/ContainerAllocationPolicies.h
Normal file
29
Project Reboot 3.0/ContainerAllocationPolicies.h
Normal file
@@ -0,0 +1,29 @@
|
||||
#pragma once
|
||||
|
||||
template <int NumElements>
|
||||
class TInlineAllocator
|
||||
{
|
||||
private:
|
||||
template <int Size, int Alignment>
|
||||
struct alignas(Alignment) TAlignedBytes
|
||||
{
|
||||
unsigned char Pad[Size];
|
||||
};
|
||||
|
||||
template <typename ElementType>
|
||||
struct TTypeCompatibleBytes : public TAlignedBytes<sizeof(ElementType), alignof(ElementType)>
|
||||
{
|
||||
};
|
||||
|
||||
public:
|
||||
template <typename ElementType>
|
||||
class ForElementType
|
||||
{
|
||||
friend class TBitArray;
|
||||
|
||||
private:
|
||||
TTypeCompatibleBytes<ElementType> InlineData[NumElements];
|
||||
|
||||
ElementType* SecondaryData;
|
||||
};
|
||||
};
|
||||
Reference in New Issue
Block a user