libcsdbg  1.28
C++ exception (and generic) stack trace debug library
string & csdbg::string::set ( const string src)
virtual

Copy a string.

Parameters
[in]srcthe source string
Returns
*this
Exceptions
std::bad_alloc

Definition at line 296 of file string.cpp.

References m_data, m_length, memalign(), and unlikely.

297 {
298  if ( unlikely(this == &src) )
299  return *this;
300 
301  memalign(src.m_length);
302  strcpy(m_data, src.m_data);
303  m_length = src.m_length;
304  return *this;
305 }
virtual string & memalign(u32, bool=false)
Allocate aligned memory, mandate a minimum buffer size.
Definition: string.cpp:26
i8 * m_data
String data.
Definition: string.hpp:42
#define unlikely(expr)
Offer a hint (negative) to the pipeline branch predictor.
Definition: config.hpp:349
u32 m_length
Character count.
Definition: string.hpp:44

+ Here is the call graph for this function: