MCPcopy Create free account
hub / github.com/bfbbdecomp/bfbb / OSCreateHeap

Function OSCreateHeap

src/dolphin/src/os/OSAlloc.c:192–214  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

190}
191
192OSHeapHandle OSCreateHeap(void* start, void* end)
193{
194 int i;
195 HeapCell* cell = (void*)OSRoundUp32B(start);
196
197 end = (void*)OSRoundDown32B(end);
198 for (i = 0; i < NumHeaps; i++)
199 {
200 Heap* hd = &HeapArray[i];
201
202 if (hd->size < 0)
203 {
204 hd->size = (u8*)end - (u8*)cell;
205 cell->prev = NULL;
206 cell->next = NULL;
207 cell->size = hd->size;
208 hd->free = cell;
209 hd->allocated = NULL;
210 return i;
211 }
212 }
213 return -1;
214}

Callers 2

InitDefaultHeapFunction · 0.85
iMemInitFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected