| 113 | |
| 114 | template <class Alloc> |
| 115 | Ext::SharedQueueEntry* Ext::SharedQueueEntryPool<Alloc>::getEntry(void* objectRef) |
| 116 | { |
| 117 | SharedQueueEntry* e = static_cast<SharedQueueEntry*>(mTaskEntryPtrPool.pop()); |
| 118 | if (e) |
| 119 | { |
| 120 | PX_ASSERT(e->mPooledEntry == true); |
| 121 | e->mObjectRef = objectRef; |
| 122 | return e; |
| 123 | } |
| 124 | else |
| 125 | { |
| 126 | Ps::AlignedAllocator<PX_SLIST_ALIGNMENT, Alloc> alignedAlloc; |
| 127 | e = reinterpret_cast<SharedQueueEntry*>(alignedAlloc.allocate(sizeof(SharedQueueEntry), __FILE__, __LINE__)); |
| 128 | if (e) |
| 129 | { |
| 130 | PX_PLACEMENT_NEW(e, SharedQueueEntry)(objectRef); |
| 131 | PX_ASSERT(e->mPooledEntry == false); |
| 132 | } |
| 133 | |
| 134 | return e; |
| 135 | } |
| 136 | } |
| 137 | |
| 138 | |
| 139 | template <class Alloc> |
no test coverage detected