MCPcopy Create free account
hub / github.com/WheretIB/nullc / Create

Method Create

ObjectPool.h:80–100  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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 {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected