| 59 | ppool->pobjpageHead = pool_allocate_page(cbObject); |
| 60 | } |
| 61 | static int IdxAllocObject(struct object_page *page) |
| 62 | { |
| 63 | for (size_t iword = 0; iword < OBJ_PAGE_BITS_PER_WORD; ++iword) |
| 64 | { |
| 65 | if ((page->allocmap[iword] + 1) != 0) |
| 66 | { |
| 67 | int ibit = 0; |
| 68 | uint64_t bitword = page->allocmap[iword]; |
| 69 | while (bitword & 1) |
| 70 | { |
| 71 | bitword >>= 1; |
| 72 | ++ibit; |
| 73 | } |
| 74 | page->allocmap[iword] |= 1ULL << ibit; |
| 75 | return (iword * OBJ_PAGE_BITS_PER_WORD) + ibit; |
| 76 | } |
| 77 | } |
| 78 | return -1; |
| 79 | } |
| 80 | void *pool_alloc(struct alloc_pool *ppool) |
| 81 | { |
| 82 | struct object_page *cur = ppool->pobjpageHead; |