MCPcopy Create free account
hub / github.com/devosoft/avida / CopyOnWrite

Method CopyOnWrite

avida-core/source/tools/cString.h:571–576  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

569// -- INLINE INCLUDES --
570
571void cString::CopyOnWrite()
572{
573 if (value->RefCount() != 1) { // if it is shared
574 value = Apto::SmartPtr<cStringData, Apto::InternalRCObject>(new cStringData(*value)); // make own copy of value
575 }
576}
577
578cString::cCharProxy & cString::cCharProxy::operator= (char c){ // lvalue
579 string.CopyOnWrite();

Callers 3

cString.hFile · 0.80
operator++Method · 0.80
operator--Method · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected