mirror of
https://github.com/wiiu-env/MemoryMappingModule.git
synced 2024-11-22 09:49:20 +01:00
Implement MemoryMapping_MEMGetAllocatableSize and MemoryMapping_MEMGetAllocatableSizeEx
This commit is contained in:
parent
5ebc7e9de8
commit
989b455eff
@ -433,6 +433,25 @@ void MemoryMapping_free(void *ptr) {
|
||||
}
|
||||
}
|
||||
|
||||
uint32_t MemoryMapping_MEMGetAllocatableSize() {
|
||||
return MemoryMapping_MEMGetAllocatableSizeEx(4);
|
||||
}
|
||||
|
||||
uint32_t MemoryMapping_MEMGetAllocatableSizeEx(uint32_t align) {
|
||||
uint32_t res = 0;
|
||||
for (int32_t i = 0; /* waiting for a break */; i++) {
|
||||
if (mem_mapping[i].physical_addresses == NULL) {
|
||||
break;
|
||||
}
|
||||
uint32_t curRes = MEMGetAllocatableSizeForExpHeapEx((MEMHeapHandle) mem_mapping[i].effective_start_address, align);
|
||||
DEBUG_FUNCTION_LINE("heap at %08X MEMGetAllocatableSizeForExpHeapEx: %d KiB", mem_mapping[i].effective_start_address, curRes / 1024);
|
||||
if (curRes > res) {
|
||||
res = curRes;
|
||||
}
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
uint32_t MemoryMapping_GetFreeSpace() {
|
||||
uint32_t res = 0;
|
||||
for (int32_t i = 0; /* waiting for a break */; i++) {
|
||||
|
@ -164,6 +164,10 @@ const memory_values_t mem_vals_heap[] = {
|
||||
};
|
||||
|
||||
|
||||
uint32_t MemoryMapping_MEMGetAllocatableSize();
|
||||
|
||||
uint32_t MemoryMapping_MEMGetAllocatableSizeEx(uint32_t align);
|
||||
|
||||
bool MemoryMapping_isMemoryMapped();
|
||||
|
||||
void MemoryMapping_setupMemoryMapping();
|
||||
|
Loading…
Reference in New Issue
Block a user