------------------------------------------------------------------------ concurrent_queue_base ------------------------------------------------------------------------
| 348 | // concurrent_queue_base |
| 349 | //------------------------------------------------------------------------ |
| 350 | concurrent_queue_base_v3::concurrent_queue_base_v3( size_t item_sz ) { |
| 351 | items_per_page = item_sz<= 8 ? 32 : |
| 352 | item_sz<= 16 ? 16 : |
| 353 | item_sz<= 32 ? 8 : |
| 354 | item_sz<= 64 ? 4 : |
| 355 | item_sz<=128 ? 2 : |
| 356 | 1; |
| 357 | my_capacity = size_t(-1)/(item_sz>1 ? item_sz : 2); |
| 358 | my_rep = cache_aligned_allocator<concurrent_queue_rep>().allocate(1); |
| 359 | __TBB_ASSERT( (size_t)my_rep % NFS_GetLineSize()==0, "alignment error" ); |
| 360 | __TBB_ASSERT( (size_t)&my_rep->head_counter % NFS_GetLineSize()==0, "alignment error" ); |
| 361 | __TBB_ASSERT( (size_t)&my_rep->tail_counter % NFS_GetLineSize()==0, "alignment error" ); |
| 362 | __TBB_ASSERT( (size_t)&my_rep->array % NFS_GetLineSize()==0, "alignment error" ); |
| 363 | memset(my_rep,0,sizeof(concurrent_queue_rep)); |
| 364 | new ( &my_rep->items_avail ) concurrent_monitor(); |
| 365 | new ( &my_rep->slots_avail ) concurrent_monitor(); |
| 366 | this->item_size = item_sz; |
| 367 | } |
| 368 | |
| 369 | concurrent_queue_base_v3::~concurrent_queue_base_v3() { |
| 370 | size_t nq = my_rep->n_queue; |
nothing calls this directly
no test coverage detected