line |
true |
false |
branch |
103
|
0 |
0 |
if (!mem) throw std::bad_alloc(); |
863
|
0 |
0 |
if (str._length) { // can't call append(const CharT*, size_type) because otherwise if &str == this a fuckup would occur |
884
|
0 |
0 |
if (count) { |
1161
|
0 |
0 |
if (capacity <= MAX_SSO_CHARS) { |
1165
|
0 |
0 |
if (capacity > MAX_SIZE) throw std::length_error("basic_string::_new_auto"); |
|
0 |
0 |
if (capacity > MAX_SIZE) throw std::length_error("basic_string::_new_auto"); |
1322
|
0 |
0 |
assert(capacity >= _length); |
1335
|
0 |
0 |
if (capacity < _length) capacity = _length; |
1345
|
0 |
0 |
if (_storage.internal->refcnt > 1) _detach_cow(capacity * extra); |
1346
|
0 |
0 |
else if (_storage.internal->capacity < capacity) _internal_realloc(capacity * extra); // need to grow storage |
1347
|
0 |
0 |
else if (_capacity_internal() < capacity) { // may not to grow storage if str is moved to the beginning |
1356
|
0 |
0 |
if (_storage.dtor == &Alloc::deallocate && _str == _storage.internal->start) { |
|
0 |
0 |
if (_storage.dtor == &Alloc::deallocate && _str == _storage.internal->start) { |
1357
|
0 |
0 |
if (capacity > MAX_SIZE) throw std::length_error("basic_string::_internal_realloc"); |
|
0 |
0 |
if (capacity > MAX_SIZE) throw std::length_error("basic_string::_internal_realloc"); |
1372
|
0 |
0 |
if (_storage.external->refcnt > 1) _detach_cow(capacity * extra); |
1373
|
0 |
0 |
else if (_storage.external->capacity < capacity) _external_realloc(capacity * extra); // need to grow storage, switch to INTERNAL/SSO |
1374
|
0 |
0 |
else if (_capacity_external() < capacity) { // may not to grow storage if str is moved to the beginning |
1390
|
0 |
0 |
if (MAX_SSO_CHARS < capacity) { |
1394
|
0 |
0 |
else if (_capacity_sso() < capacity) { |
1501
|
0 |
0 |
static void _release_internal (Buffer* buf, dtor_fn dtor) { if (!--buf->refcnt) _free_internal(buf, dtor); } |
1502
|
0 |
0 |
static void _release_external (ExternalShared* ebuf, dtor_fn dtor) { if (!--ebuf->refcnt) _free_external(ebuf, dtor); } |