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 T * Allocate(std::size_t a_numElements)
Definition NiTCollection.h:49
static void Deallocate(T *a_array)
Definition NiTCollection.h:58
Definition AbsorbEffect.h:6
T * malloc()
Definition MemoryManager.h:113
T * NiAlloc(std::size_t a_count)
Definition NiTCollection.h:18
void NiAlignedFree(void *a_mem)
void * NiMalloc(std::size_t a_sizeInBytes)
T * NiAlignedAlloc(std::size_t a_count, std::size_t a_alignment)
Definition NiTCollection.h:25
void * NiRealloc(void *a_mem, std::size_t a_sizeInBytes)
void * NiAlignedMalloc(std::size_t a_sizeInBytes, std::size_t a_alignment)
constexpr bool NiTrackFree(void *a_mem)
Definition NiTCollection.h:14
void free(void *a_ptr)
Definition MemoryManager.h:187
constexpr bool NiTrackAlloc(void *a_mem, std::size_t a_sizeInBytes)
Definition NiTCollection.h:13
void * NiAlignedRealloc(void *a_mem, std::size_t a_sizeInBytes, std::size_t a_alignment)