Getting completely (I mean ENTIRELY) rid off GC

po via Digitalmars-d digitalmars-d at puremagic.com
Sat Sep 13 09:48:07 PDT 2014


> Are you sure? From basic_string.h:
>
> 	_CharT*
> 	_M_refcopy() throw()
> 	{
> #ifndef _GLIBCXX_FULLY_DYNAMIC_STRING
> 	  if (__builtin_expect(this != &_S_empty_rep(), false))
> #endif
>             
> __gnu_cxx::__atomic_add_dispatch(&this->_M_refcount, 1);
> 	  return _M_refdata();
> 	}  // XXX MT

  COW is just an implementation detail of GCC's crappy string.

  Microsoft string for instance, does not do COW, it uses a 15 
byte SBO. And you can also just replace it with your own string 
type(EASTL)


More information about the Digitalmars-d mailing list