MCPcopy Create free account
hub / github.com/emscripten-core/emscripten / __libcpp_refstring

Method __libcpp_refstring

system/lib/libcxx/src/include/refstring.h:78–87  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

76using namespace __refstring_imp;
77
78inline __libcpp_refstring::__libcpp_refstring(const char* msg) {
79 std::size_t len = strlen(msg);
80 _Rep_base* rep = static_cast<_Rep_base*>(::operator new(sizeof(*rep) + len + 1));
81 rep->len = len;
82 rep->cap = len;
83 rep->count = 0;
84 char* data = data_from_rep(rep);
85 std::memcpy(data, msg, len + 1);
86 __imp_ = data;
87}
88
89inline __libcpp_refstring::__libcpp_refstring(const __libcpp_refstring& s) noexcept : __imp_(s.__imp_) {
90 if (__uses_refcount())

Callers

nothing calls this directly

Calls 5

strlenFunction · 0.85
data_from_repFunction · 0.85
memcpyFunction · 0.85
rep_from_dataFunction · 0.85
operator newFunction · 0.50

Tested by

no test coverage detected