MCPcopy Create free account
hub / github.com/cameron314/concurrentqueue / push

Method push

benchmarks/dlib/stack/stack_kernel_1.h:291–308  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

289 typename mem_manager
290 >
291 void stack_kernel_1<T,mem_manager>::
292 push(
293 T& item
294 )
295 {
296 // allocate memory for new node
297 node* new_node = pool.allocate();
298
299 // swap item into new_node
300 exchange(new_node->item,item);
301
302 // put new_node into stack
303 new_node->next = top;
304 top = new_node;
305 ++stack_size;
306
307 reset();
308 }
309
310// ----------------------------------------------------------------------------------------
311

Callers

nothing calls this directly

Calls 2

exchangeFunction · 0.85
allocateMethod · 0.45

Tested by

no test coverage detected