line |
true |
false |
branch |
58
|
0 |
0 |
if (!mem) throw std::bad_alloc(); |
1134
|
0 |
0 |
if (capacity <= MAX_SSO_CHARS) { |
1138
|
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"); |
1278
|
0 |
1240 |
if (_buf->refcnt > 1) _detach_cow(_length); |
1293
|
0 |
0 |
assert(capacity >= _length); |
1304
|
0 |
1290 |
if (capacity < _length) capacity = _length; |
1314
|
0 |
1285 |
if (_buf->refcnt > 1) _detach_cow(capacity); |
1315
|
1285 |
0 |
else if (_buf->capacity < capacity) _internal_realloc(capacity); // need to grow storage |
1316
|
0 |
0 |
else if (_capacity_internal() < capacity) { // may not to grow storage if str is moved to the beginning |
1325
|
1285 |
0 |
if (_dtor == &Alloc::deallocate && _str == _buf->start) { |
|
1285 |
0 |
if (_dtor == &Alloc::deallocate && _str == _buf->start) { |
1326
|
0 |
1285 |
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"); |
1341
|
0 |
0 |
if (_buf->refcnt > 1) _detach_cow(capacity); |
1342
|
0 |
0 |
else if (_buf->capacity < capacity) _external_realloc(capacity); // need to grow storage, switch to INTERNAL/SSO |
1343
|
0 |
0 |
else if (_capacity_external() < capacity) { // may not to grow storage if str is moved to the beginning |
1359
|
1 |
4 |
if (MAX_SSO_CHARS < capacity) { |
1363
|
0 |
4 |
else if (_capacity_sso() < capacity) { |
1470
|
0 |
0 |
static void _release_internal (Buffer* buf, dtor_fn dtor) { if (!--buf->refcnt) _free_internal(buf, dtor); } |
1471
|
0 |
0 |
static void _release_external (ExternalShared* ebuf, dtor_fn dtor) { if (!--ebuf->refcnt) _free_external(ebuf, dtor); } |