| 78 | return -1; |
| 79 | } |
| 80 | void *pool_alloc(struct alloc_pool *ppool) |
| 81 | { |
| 82 | struct object_page *cur = ppool->pobjpageHead; |
| 83 | for (;;) |
| 84 | { |
| 85 | int idx = IdxAllocObject(cur); |
| 86 | if (idx >= 0) |
| 87 | { |
| 88 | return cur->rgb() + (((size_t)ppool->cbObject) * idx); |
| 89 | } |
| 90 | |
| 91 | if (cur->pnext == NULL) |
| 92 | { |
| 93 | cur->pnext = pool_allocate_page(ppool->cbObject); |
| 94 | } |
| 95 | |
| 96 | cur = cur->pnext; |
| 97 | } |
| 98 | } |
| 99 | |
| 100 | void pool_free(struct alloc_pool *ppool, void *pv) |
| 101 | { |
no test coverage detected