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

Class ECBFrameAllocator

BG3Extender/GameDefinitions/EntitySystem.h:149–182  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

147};
148
149struct ECBFrameAllocator
150{
151 inline ECBFrameAllocator(FrameAllocator* allocator)
152 : Allocator(allocator)
153 {}
154
155 inline ECBFrameAllocator(ECBFrameAllocator const& allocator)
156 : Allocator(allocator.Allocator)
157 {}
158
159 FrameAllocator* Allocator;
160
161 inline void* alloc(std::size_t size)
162 {
163 se_assert(size <= 0xFFC0);
164 return Allocator->Allocate((uint16_t)size);
165 }
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 {
180 Allocator->Free(ptr);
181 }
182};
183
184struct ComponentTypeEntry : public ProtectedGameObject<ComponentTypeEntry>
185{

Callers 1

ECBEntityChangeSetMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected