| 443 | } |
| 444 | |
| 445 | void* xMemPoolAlloc(xMemPool* pool) |
| 446 | { |
| 447 | void* retval = pool->FreeList; |
| 448 | U32 next = pool->NextOffset; |
| 449 | U32 flags = pool->Flags; |
| 450 | |
| 451 | if (retval == NULL) |
| 452 | { |
| 453 | xMemPoolAddElements(pool, xMemAlloc(gActiveHeap, pool->NumRealloc * pool->Size, 0), |
| 454 | pool->NumRealloc); |
| 455 | retval = pool->FreeList; |
| 456 | } |
| 457 | |
| 458 | pool->FreeList = *(void**)((U32)retval + next); |
| 459 | if (flags & 1) |
| 460 | { |
| 461 | *(void**)((U32)retval + next) = pool->UsedList; |
| 462 | pool->UsedList = retval; |
| 463 | } |
| 464 | |
| 465 | return retval; |
| 466 | } |
| 467 | |
| 468 | void xMemPoolFree(xMemPool* pool, void* data) |
| 469 | { |
no test coverage detected