Decomped DoAlloc

Decomped by Kermalis
This commit is contained in:
AnonymousRandomPerson
2024-10-22 22:20:03 -04:00
parent dd8c864e38
commit 67e8cd8400
3 changed files with 6 additions and 13 deletions

View File

@@ -5,18 +5,6 @@
.text
thumb_func_start DoAlloc
DoAlloc:
push {lr}
movs r3, 0x80
lsls r3, 1
orrs r3, r2
adds r2, r3, 0
bl _LocateSet
pop {r1}
bx r1
thumb_func_end DoAlloc
thumb_func_start DoFree
DoFree:
push {r4-r7,lr}

View File

@@ -87,5 +87,6 @@ void *MemoryAlloc(s32 size, s32 group);
void MemoryFree(void *a);
struct HeapDescriptor *DoCreateSubHeap(struct unkMemoryStruct *a, u32 b);
void xxx_unused_memory_free(struct HeapDescriptor *a1);
void *DoAlloc(struct HeapDescriptor *heap, s32 size, u32 a2);
#endif // GUARD_MEMORY_H

View File

@@ -89,7 +89,6 @@ struct HeapDescriptor *MemoryLocate_LocalCreate(struct HeapDescriptor *parentHea
return iVar3;
}
// Note: This is called after _LocateSetBack which currently returns a HeapDescriptor* which is incorrect
struct HeapDescriptor *DoCreateSubHeap(struct unkMemoryStruct *a, u32 b)
{
struct HeapMemoryBlock2 s2;
@@ -134,3 +133,8 @@ void xxx_unused_memory_free(struct HeapDescriptor *a1)
DoFree(a1->parentHeap, a1);
}
}
void *DoAlloc(struct HeapDescriptor *heap, s32 size, u32 a2)
{
return _LocateSet(heap, size, a2 | 0x100);
}