9 void*
NiRealloc(
void* a_mem, std::size_t a_sizeInBytes);
10 void*
NiAlignedRealloc(
void* a_mem, std::size_t a_sizeInBytes, std::size_t a_alignment);
13 constexpr
bool NiTrackAlloc([[maybe_unused]]
void* a_mem, [[maybe_unused]] std::size_t a_sizeInBytes) {
return false; }
14 constexpr
bool NiTrackFree([[maybe_unused]]
void* a_mem) {
return false; }
20 return static_cast<T*
>(
NiMalloc(
sizeof(T) * a_count));
27 return static_cast<T*
>(
NiAlignedMalloc(
sizeof(T) * a_count, a_alignment));
34 inline static T*
Allocate(std::size_t a_numElements)
36 return static_cast<T*
>(
NiMalloc(
sizeof(T) * a_numElements));
49 inline static T*
Allocate(std::size_t a_numElements)
51 auto mem =
malloc(
sizeof(std::size_t) +
sizeof(T) * a_numElements);
52 auto head =
static_cast<std::size_t*
>(mem);
53 *head = a_numElements;
55 return static_cast<T*
>(mem);
61 auto head = stl::adjust_pointer<std::size_t>(a_array, -stl::ssizeof_v<std::uintptr_t>);
62 for (std::size_t i = 0; i < *head; ++i) {
Definition: NiTCollection.h:32
static T * Allocate(std::size_t a_numElements)
Definition: NiTCollection.h:34
static void Deallocate(T *a_array)
Definition: NiTCollection.h:39
Definition: NiTCollection.h:47
static void Deallocate(T *a_array)
Definition: NiTCollection.h:58
static T * Allocate(std::size_t a_numElements)
Definition: NiTCollection.h:49
Definition: AbsorbEffect.h:6
void * NiMalloc(std::size_t a_sizeInBytes)
void * NiAlignedRealloc(void *a_mem, std::size_t a_sizeInBytes, std::size_t a_alignment)
void NiAlignedFree(void *a_mem)
void * NiRealloc(void *a_mem, std::size_t a_sizeInBytes)
T * NiAlloc(std::size_t a_count)
Definition: NiTCollection.h:18
constexpr bool NiTrackFree([[maybe_unused]] void *a_mem)
Definition: NiTCollection.h:14
void * NiAlignedMalloc(std::size_t a_sizeInBytes, std::size_t a_alignment)
void * malloc(std::size_t a_size)
Definition: MemoryManager.h:98
T * NiAlignedAlloc(std::size_t a_count, std::size_t a_alignment)
Definition: NiTCollection.h:25
void free(void *a_ptr)
Definition: MemoryManager.h:183
constexpr bool NiTrackAlloc([[maybe_unused]] void *a_mem, [[maybe_unused]] std::size_t a_sizeInBytes)
Definition: NiTCollection.h:13