ksys/evt: Implement eventFlowAlloc/Free

This commit is contained in:
Léo Lam
2021-06-17 23:51:57 +02:00
parent 357ef77879
commit 328354f857
2 changed files with 20 additions and 2 deletions
+18
View File
@@ -1 +1,19 @@
#include "KingSystem/Event/evtEventResource.h"
#include <heap/seadHeap.h>
namespace ksys::evt {
void* eventFlowAlloc(size_t size, size_t alignment, void* userdata) {
auto* heap = static_cast<sead::Heap*>(userdata);
if (!heap)
return nullptr;
return heap->tryAlloc(size, static_cast<int>(alignment));
}
void eventFlowFree(void* ptr, void* userdata) {
auto* heap = static_cast<sead::Heap*>(userdata);
if (heap)
heap->free(ptr);
}
} // namespace ksys::evt