MCPcopy Create free account
hub / github.com/HelenOS/helenos / init_

Method init_

uspace/lib/cpp/include/__bits/string/string.hpp:1495–1506  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1493 static constexpr size_type default_capacity_{4};
1494
1495 void init_(const value_type* str, size_type size)
1496 {
1497 if (data_)
1498 allocator_.deallocate(data_, capacity_);
1499
1500 size_ = size;
1501 capacity_ = size + 1;
1502
1503 data_ = allocator_.allocate(capacity_);
1504 traits_type::copy(data_, str, size);
1505 ensure_null_terminator_();
1506 }
1507
1508 size_type next_capacity_(size_type hint = 0) const noexcept
1509 {

Callers

nothing calls this directly

Calls 3

copyFunction · 0.85
deallocateMethod · 0.45
allocateMethod · 0.45

Tested by

no test coverage detected