MCPcopy Create free account
hub / github.com/MegEngine/MegEngine / do_add

Method do_add

src/core/impl/utils/metahelper.cpp:18–22  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

16}
17
18void UserDataContainer::do_add(Typeinfo* type, std::shared_ptr<UserData> data) {
19 auto ins = m_refkeeper.emplace(std::move(data));
20 mgb_assert(ins.second, "duplicated user data: %p", ins.first->get());
21 m_storage[type].push_back(ins.first->get());
22}
23
24std::pair<void* const*, size_t> UserDataContainer::do_get(Typeinfo* type) const {
25 auto iter = m_storage.find(type);

Callers

nothing calls this directly

Calls 3

emplaceMethod · 0.45
getMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected