41 enum { Value =
false };
44 template <>
struct TIsIntegral< bool> {
enum { Value =
true }; };
45 template <>
struct TIsIntegral< char> {
enum { Value =
true }; };
46 template <>
struct TIsIntegral<signed char> {
enum { Value =
true }; };
47 template <>
struct TIsIntegral<unsigned char> {
enum { Value =
true }; };
48 template <>
struct TIsIntegral< char16_t> {
enum { Value =
true }; };
49 template <>
struct TIsIntegral< char32_t> {
enum { Value =
true }; };
50 template <>
struct TIsIntegral< wchar_t> {
enum { Value =
true }; };
51 template <>
struct TIsIntegral< short> {
enum { Value =
true }; };
52 template <>
struct TIsIntegral<unsigned short> {
enum { Value =
true }; };
53 template <>
struct TIsIntegral< int> {
enum { Value =
true }; };
54 template <>
struct TIsIntegral<unsigned int> {
enum { Value =
true }; };
55 template <>
struct TIsIntegral< long> {
enum { Value =
true }; };
56 template <>
struct TIsIntegral<unsigned long> {
enum { Value =
true }; };
57 template <>
struct TIsIntegral< long long> {
enum { Value =
true }; };
58 template <>
struct TIsIntegral<unsigned long long> {
enum { Value =
true }; };
60 template <
typename T>
struct TIsIntegral<const T> {
enum { Value = TIsIntegral<T>::Value }; };
61 template <
typename T>
struct TIsIntegral< volatile T> {
enum { Value = TIsIntegral<T>::Value }; };
63 template <
typename T>
struct TIsIntegral<const volatile T> {
enum { Value = TIsIntegral<T>::Value }; };
74 enum { Value =
false };
77 template <
typename T>
struct TIsPointer<T*> {
enum { Value =
true }; };
79 template <
typename T>
struct TIsPointer<const T> {
enum { Value = TIsPointer<T>::Value }; };
80 template <
typename T>
struct TIsPointer< volatile T> {
enum { Value = TIsPointer<T>::Value }; };
82 template <
typename T>
struct TIsPointer<const volatile T> {
enum { Value = TIsPointer<T>::Value }; };
95 KR_CORE_ASSERT(TIsIntegral<T>::Value || TIsPointer<T>::Value,
"Align expects an integer or pointer type");
97 return (T)(((uint64_t)Val + Alignment - 1) & ~(Alignment - 1));
119 m_PermanentObjectPoolSize(0),
120 m_PermanentObjectPool(nullptr),
121 m_PermanentObjectPoolTail(nullptr),
122 m_PermanentObjectPoolExceededTail(nullptr)
145 void Initialize(uint8_t* pMemoryStart,
size_t elemetSizeBytes,
size_t numberOfElemets);
164 return ((
const uint8_t*)Object >= m_PermanentObjectPool) && ((
const uint8_t*)Object < m_PermanentObjectPoolTail);
262 int32_t m_PermanentObjectPoolSize;
265 uint8_t* m_PermanentObjectPool;
268 uint8_t* m_PermanentObjectPoolTail;
271 uint8_t* m_PermanentObjectPoolEnd;
274 uint8_t* m_PermanentObjectPoolExceededTail;
277 uint32_t m_BareUObjectsSize;
280 uint32_t m_AlignedUObjectsSize;
288 uint32_t m_NumberOfUObjects;
303 extern KARMA_API FUObjectAllocator GUObjectAllocator;
#define KARMA_API
Defining Karma's API macro for storage class information.
Definition Core.h:41
#define FORCEINLINE
Typical inlining macro for clarity.
Definition Core.h:157
void(* FUObjectAllocatorCallback)(void *InObject, const std::string &InName, size_t InSize, size_t InAlignment, class UClass *InClass)
A definition useful for UObjects statistics.
Definition UObjectAllocator.h:33
FORCEINLINE constexpr T Align(T Val, uint64_t Alignment)
Definition UObjectAllocator.h:93
uint8_t * GetPermanentObjectPool() const
Definition UObjectAllocator.h:222
uint32_t GetPermanentPoolSize() const
Definition UObjectAllocator.h:229
void BootMessage()
Definition UObjectAllocator.cpp:32
uint8_t * GetPermanentObjectPoolTail() const
Definition UObjectAllocator.h:215
uint8_t * GetPermanentObjectPoolEnd() const
Definition UObjectAllocator.h:236
FUObjectAllocator()
Definition UObjectAllocator.h:118
void RegisterUObjectsStatisticsCallback(FUObjectAllocatorCallback dumpCallback)
Definition UObjectAllocator.cpp:97
uint32_t GetNumberOfUObjects() const
Definition UObjectAllocator.h:257
uint32_t GetBareUObjectSize() const
Definition UObjectAllocator.h:243
void DumpUObjectsInformation(void *InObject, const std::string &InName, size_t InSize, size_t InAlignment, class UClass *InClass)
Definition UObjectAllocator.cpp:102
uint32_t GetAlignedUObjectSize() const
Definition UObjectAllocator.h:250
UObjectBase * AllocateUObject(size_t Size, size_t Alignment, bool bAllowPermanent)
Allocates a UObjectBase from the free store or the permanent object pool.
Definition UObjectAllocator.cpp:44
void Initialize(uint8_t *pMemoryStart, size_t elemetSizeBytes, size_t numberOfElemets)
Definition UObjectAllocator.cpp:19
void AllocatePermanentObjectPool(int32_t InPermanentObjectPoolSize)
Definition UObjectAllocator.cpp:11
FORCEINLINE bool ResidesInPermanentPool(const UObjectBase *Object) const
Definition UObjectAllocator.h:162
An object class.
Definition Class.h:158
Low level implementation of UObject, should not be used directly in game code.
Definition UObjectBase.h:36
Karma's std::vector wrapper.
Definition KarmaTypes.h:152
Definition UObjectAllocator.h:40
Traits class which tests if a type is a pointer.
Definition UObjectAllocator.h:73