| 190 | } |
| 191 | |
| 192 | OSHeapHandle 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 | } |
no outgoing calls
no test coverage detected