| 78 | } |
| 79 | |
| 80 | T* Create() |
| 81 | { |
| 82 | allocated++; |
| 83 | MySmallBlock* result; |
| 84 | if(freeBlocks) |
| 85 | { |
| 86 | result = freeBlocks; |
| 87 | freeBlocks = freeBlocks->next; |
| 88 | |
| 89 | }else{ |
| 90 | if(lastNum == countInBlock) |
| 91 | { |
| 92 | MyLargeBlock* newPage = new MyLargeBlock; |
| 93 | newPage->next = activePages; |
| 94 | activePages = newPage; |
| 95 | lastNum = 0; |
| 96 | } |
| 97 | result = &activePages->page[lastNum++]; |
| 98 | } |
| 99 | return ::new(static_cast<void*>(result)) T(); |
| 100 | } |
| 101 | |
| 102 | void Destroy(T* ptr) |
| 103 | { |
nothing calls this directly
no outgoing calls
no test coverage detected