libcsdbg  1.28
C++ exception (and generic) stack trace debug library
template<class T >
chain< T > & csdbg::chain< T >::clear ( )
virtual

Empty the chain.

Returns
*this

Definition at line 413 of file chain.hpp.

References likely, and csdbg::node< T >::link().

414 {
415  node<T> *cur = m_head, *prev = NULL, *next;
416  while ( likely(cur != NULL) ) {
417  next = cur->link(prev);
418  prev = cur;
419 
420  delete cur;
421  cur = next;
422  }
423 
424  m_head = m_tail = NULL;
425  m_size = 0;
426  return *this;
427 }
u32 m_size
Node count.
Definition: chain.hpp:43
#define likely(expr)
Offer a hint (positive) to the pipeline branch predictor.
Definition: config.hpp:344
node< T > * m_tail
Chain tail.
Definition: chain.hpp:41
node< T > * m_head
Chain head.
Definition: chain.hpp:39

+ Here is the call graph for this function: