mirror of
https://github.com/zeldaret/botw
synced 2026-06-24 17:03:19 -04:00
ksys/evt: Implement eventFlowAlloc/Free
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user