43 enum { Value =
false };
46 template <>
struct TIsIntegral< bool> {
enum { Value =
true }; };
47 template <>
struct TIsIntegral< char> {
enum { Value =
true }; };
48 template <>
struct TIsIntegral<signed char> {
enum { Value =
true }; };
49 template <>
struct TIsIntegral<unsigned char> {
enum { Value =
true }; };
50 template <>
struct TIsIntegral< char16_t> {
enum { Value =
true }; };
51 template <>
struct TIsIntegral< char32_t> {
enum { Value =
true }; };
52 template <>
struct TIsIntegral< wchar_t> {
enum { Value =
true }; };
53 template <>
struct TIsIntegral< short> {
enum { Value =
true }; };
54 template <>
struct TIsIntegral<unsigned short> {
enum { Value =
true }; };
55 template <>
struct TIsIntegral< int> {
enum { Value =
true }; };
56 template <>
struct TIsIntegral<unsigned int> {
enum { Value =
true }; };
57 template <>
struct TIsIntegral< long> {
enum { Value =
true }; };
58 template <>
struct TIsIntegral<unsigned long> {
enum { Value =
true }; };
59 template <>
struct TIsIntegral< long long> {
enum { Value =
true }; };
60 template <>
struct TIsIntegral<unsigned long long> {
enum { Value =
true }; };
62 template <
typename T>
struct TIsIntegral<const T> {
enum { Value = TIsIntegral<T>::Value }; };
63 template <
typename T>
struct TIsIntegral< volatile T> {
enum { Value = TIsIntegral<T>::Value }; };
65 template <
typename T>
struct TIsIntegral<const volatile T> {
enum { Value = TIsIntegral<T>::Value }; };
76 enum { Value =
false };
79 template <
typename T>
struct TIsPointer<T*> {
enum { Value =
true }; };
81 template <
typename T>
struct TIsPointer<const T> {
enum { Value = TIsPointer<T>::Value }; };
82 template <
typename T>
struct TIsPointer< volatile T> {
enum { Value = TIsPointer<T>::Value }; };
84 template <
typename T>
struct TIsPointer<const volatile T> {
enum { Value = TIsPointer<T>::Value }; };
97 KR_CORE_ASSERT(TIsIntegral<T>::Value || TIsPointer<T>::Value,
"Align expects an integer or pointer type");
99 return (T)(((uint64_t)Val + Alignment - 1) & ~(Alignment - 1));
121 m_PermanentObjectPoolSize(0),
122 m_PermanentObjectPool(nullptr),
123 m_PermanentObjectPoolTail(nullptr),
124 m_PermanentObjectPoolExceededTail(nullptr)
149 void Initialize(uint8_t* pMemoryStart,
size_t elemetSizeBytes,
size_t numberOfElemets);
168 return ((
const uint8_t*)Object >= m_PermanentObjectPool) && ((
const uint8_t*)Object < m_PermanentObjectPoolTail);
266 int32_t m_PermanentObjectPoolSize;
269 uint8_t* m_PermanentObjectPool;
272 uint8_t* m_PermanentObjectPoolTail;
275 uint8_t* m_PermanentObjectPoolEnd;
278 uint8_t* m_PermanentObjectPoolExceededTail;
281 uint32_t m_BareUObjectsSize;
284 uint32_t m_AlignedUObjectsSize;
292 uint32_t m_NumberOfUObjects;
307 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:170
This file contains the custom types used in Engine's logic.
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:35
FORCEINLINE constexpr T Align(T Val, uint64_t Alignment)
Definition UObjectAllocator.h:95
A pool allocator for Karma's UObjects.
Definition UObjectAllocator.h:112
uint8_t * GetPermanentObjectPool() const
Definition UObjectAllocator.h:226
uint32_t GetPermanentPoolSize() const
Definition UObjectAllocator.h:233
void BootMessage()
Definition UObjectAllocator.cpp:37
uint8_t * GetPermanentObjectPoolTail() const
Definition UObjectAllocator.h:219
uint8_t * GetPermanentObjectPoolEnd() const
Definition UObjectAllocator.h:240
FUObjectAllocator()
Definition UObjectAllocator.h:120
void RegisterUObjectsStatisticsCallback(FUObjectAllocatorCallback dumpCallback)
Definition UObjectAllocator.cpp:102
uint32_t GetNumberOfUObjects() const
Definition UObjectAllocator.h:261
uint32_t GetBareUObjectSize() const
Definition UObjectAllocator.h:247
void DumpUObjectsInformation(void *InObject, const std::string &InName, size_t InSize, size_t InAlignment, class UClass *InClass)
Definition UObjectAllocator.cpp:107
uint32_t GetAlignedUObjectSize() const
Definition UObjectAllocator.h:254
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:49
void Initialize(uint8_t *pMemoryStart, size_t elemetSizeBytes, size_t numberOfElemets)
Definition UObjectAllocator.cpp:24
void AllocatePermanentObjectPool(int32_t InPermanentObjectPoolSize)
Definition UObjectAllocator.cpp:16
FORCEINLINE bool ResidesInPermanentPool(const UObjectBase *Object) const
Definition UObjectAllocator.h:166
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 with additional functionalities.
Definition KarmaTypes.h:243
Definition UObjectAllocator.h:42
Traits class which tests if a type is a pointer.
Definition UObjectAllocator.h:75