Overhaul memory model to new Arbutils memory.
Some checks failed
continuous-integration/drone/push Build is failing
Some checks failed
continuous-integration/drone/push Build is failing
Signed-off-by: Deukhoofd <Deukhoofd@gmail.com>
This commit is contained in:
@@ -46,7 +46,7 @@ namespace CreatureLib::Battling {
|
||||
|
||||
if (_offset + sizeof(T) >= _capacity) {
|
||||
_capacity += stepSize;
|
||||
auto newPtr = realloc(_memory, _capacity);
|
||||
auto* newPtr = realloc(_memory, _capacity);
|
||||
if (newPtr == nullptr) {
|
||||
THROW("Out of memory.");
|
||||
}
|
||||
@@ -55,7 +55,7 @@ namespace CreatureLib::Battling {
|
||||
uint8_t* ptr = _memory + _offset;
|
||||
T* event = new (ptr) T(args...);
|
||||
_offset += sizeof(T);
|
||||
for (auto listener : _listeners) {
|
||||
for (const auto& listener : _listeners) {
|
||||
try_creature(listener(event), "Exception in event listener");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user