MCPcopy Create free account
hub / github.com/Norbyte/bg3se / allocArray

Method allocArray

BG3Extender/GameDefinitions/EntitySystem.h:168–176  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

166
167 template <class T, class ...Args>
168 T* allocArray(std::size_t n, Args... args)
169 {
170 se_assert(n * sizeof(T) <= 0xFFC0);
171 auto ptr = static_cast<T*>(Allocator->Allocate((uint16_t)(n * sizeof(T))));
172 for (auto i = 0; i < n; i++) {
173 new (ptr + i) T(args...);
174 }
175 return ptr;
176 }
177
178 inline void free(void* ptr)
179 {

Callers

nothing calls this directly

Calls 1

AllocateMethod · 0.45

Tested by

no test coverage detected