Overhaul memory model to new Arbutils memory.
Some checks failed
continuous-integration/drone/push Build is failing

Signed-off-by: Deukhoofd <Deukhoofd@gmail.com>
This commit is contained in:
2020-12-12 12:22:48 +01:00
parent 1dc3aafd33
commit 5c39694f19
33 changed files with 279 additions and 211 deletions

View File

@@ -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");
}
}