| 396 | } |
| 397 | |
| 398 | void xMemPoolAddElements(xMemPool* pool, void* buffer, U32 count) |
| 399 | { |
| 400 | S32 i; |
| 401 | void* curr; |
| 402 | void (*initCB)(xMemPool*, void*); |
| 403 | U32 next; |
| 404 | U32 size; |
| 405 | |
| 406 | initCB = pool->InitCB; |
| 407 | next = pool->NextOffset; |
| 408 | size = pool->Size; |
| 409 | |
| 410 | curr = buffer; |
| 411 | for (i = 0; i < (S32)count - 1; i++) |
| 412 | { |
| 413 | *(void**)((U32)curr + next) = (void*)((U32)curr + size); |
| 414 | if (initCB != NULL) |
| 415 | { |
| 416 | initCB(pool, curr); |
| 417 | } |
| 418 | curr = (void*)((U32)curr + size); |
| 419 | } |
| 420 | |
| 421 | *(void**)((U32)curr + next) = pool->FreeList; |
| 422 | if (initCB != NULL) |
| 423 | { |
| 424 | initCB(pool, curr); |
| 425 | } |
| 426 | pool->FreeList = buffer; |
| 427 | pool->Total += count; |
| 428 | } |
| 429 | |
| 430 | void xMemPoolSetup(xMemPool* pool, void* buffer, U32 nextOffset, U32 flags, xMemPoolInitCB initCB, |
| 431 | U32 size, U32 count, U32 numRealloc) |
no outgoing calls
no test coverage detected